コード例 #1
0
ファイル: punycode.php プロジェクト: honj51/taobaocrm
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;
}
コード例 #2
0
 private function validatePays($value)
 {
     if ($value == '') {
         return 1;
     }
     $value = decode_utf8($value);
     return !preg_match('/^[a-z_]{1,}$/i', $value) ? 0 : 1;
 }
コード例 #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);
 }
コード例 #4
0
 private function validateCommune($value)
 {
     if ($value == '') {
         return 1;
     }
     $value = decode_utf8($value);
     return !preg_match('/^[a-z\'\\-_\\s]{1,}$/i', $value) ? 0 : 1;
 }
コード例 #5
0
 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;
 }