PHP는 3 노트 : 문자열 작업을 배우고
, 오늘 오후에 이들을 읽고 중요한 것은 며칠 전 부분에서 읽었는데, 다른 날이었다 :
공백이나 기타 특수 기호를 제거 : ltrim, rtrim 손질
제거 가입의 백슬래시 : addcslashes, stripcslasher
HTML 요소가 생성 : htmlentities, html_entity_decode
분해 문자열 : 분할
문자열 형식 : sprintf
수집 및 대체 문자열 : substr, substr_replace
길이 문자열 수요의 : strpos
위치 문자 : 나 strlen
문자열 비교 : strncmp
다음 이메일에서 자신의 결정에 기록되고 있는지 여부를 올바른 형식과 야후에 대한 올바른 전자 - mail 주소 접미사를 교체
<?
function mails($email){
list($username,$mail)=split(’[@]‘,$email);
$check1 = strpos($email,’@');
$check2 = substr($email,$check1+1);
$check3 = strlen($check2);
$email1 = substr_replace($mail,’yahoo’,0,strpos($mail,’.'));
/*$a=strcmp($check1,0);
$b=strcmp($check2,0);
if ($a > 0 and $b > 0) {*/
if ($check1 > 0 and $check3 > 0) {
echo $username.’@’.$email1.’<br>’;
}
else
echo "Email address is not correct.<br>";
}
mails("from2004.com@ysdfdf.com");
mails("rrdsfd.com");
?>














