Exemplo n.º 1
0
function decode_punycode_item($name, $useutf8 = true)
{
    if (substr($name, 0, 4) == "xn--") {
        $punycode = new Punycode();
        $name = $punycode->decode($name);
        if (!$useutf8) {
            $name = decode_utf8($name);
        }
    }
    return $name;
}
 private function validatePays($value)
 {
     if ($value == '') {
         return 1;
     }
     $value = decode_utf8($value);
     return !preg_match('/^[a-z_]{1,}$/i', $value) ? 0 : 1;
 }
Exemplo n.º 3
0
 /**
  * Convert a string from UTF-8 to any of various encodings
  *
  * Return if set to TRUE, the original string is retunred on errors
  *
  * @param string $strValue
  * @param string $strEncoding
  * @param bool   $booSafemode
  *
  * @return string|false on failure
  *
  * @see decode_utf8
  */
 public static function decodeUtf8($strValue = '', $strEncoding = 'iso-8859-1', $booSafemode = false)
 {
     return decode_utf8($strValue = '', $strEncoding = 'iso-8859-1', $booSafemode = false);
 }
 private function validateCommune($value)
 {
     if ($value == '') {
         return 1;
     }
     $value = decode_utf8($value);
     return !preg_match('/^[a-z\'\\-_\\s]{1,}$/i', $value) ? 0 : 1;
 }
 private function validatePrenom($value)
 {
     $value = decode_utf8($value);
     return !preg_match("/^[A-Za-z]{1,}[\\-\\ \\']?[A-Za-z]{1,}[\\-\\ \\']?[A-Za-z]{1,}\$/i", $value) ? 0 : 1;
 }