This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isValidInetAddress($data, $strict = false){ | |
// 次の行は、表示改行されていますが実際は一行です | |
$regex = $strict ? ' /^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i ' : | |
' /^([*+!.&#$|\'\\%\/0-9a-z^_`{ }=?~:-]+])@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i '; | |
if(preg_match($regex, trim($data),$matches)){ | |
return array($matches[1], $matches[2]); | |
}else{ | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 文字列中のnullバイトを削除する関数 | |
* 引数が配列の場合は、配列の要素に対して再帰的に処理を行う | |
*/ | |
function delete_null_byte($value){ | |
if (is_string($value) === true) { | |
$value = str_replace("\0", "", $value); | |
} elseif (is_array($value) === true) { | |
$value = array_map('delete_null_byte', $value); |
OlderNewer