I have tried using preg_match like this code:
if(!preg_match("/@/",$save_email)&$save_email!=""){$warn14 = "<div style=\"color:red;font-size:9px\">Email should be contain "@"</div>";}
but it's didn't show anything, my webpage disappear instead ,and when I delete this code, then my web page appear. Is there some mistake on my code? (on http://php.net/preg_match) I got the example like this:
<?php$str ="aaa@yahoo.com";if (preg_match("/@/", $str)) { echo "Match was found <br /><br /><br />";}else{echo"this didn't match";}?>
I change this code a little, this is can be run, but when I tried on my project it didn't show anything and cause my web page disappear, and I forgot yesterday , even if I using eregi the result is not complete, this is my code :
<?$str ="01234";if(!eregi('^[0-9]$',$str)){echo"this is contains alphabetical";}else{echo"correct";}?>
It's still show "this is contains alphabetical", supposed it's shown "correct". now what I must do? please help me Thanks