http://localhost/sssss/sss.php&send=90开发者_如何学Go&msg=z a data c guys i need to validate for the particular data which is in the url... validate function should be able to check for special characters only for that data ... how to achieve this.... i need to validate in such a manner that no special characters will be in included along with the data.... and the url is how we use for recharging so spaces everything will be included
Use this:
$msg = $_GET['msg'];
list(,,,$amount,) = explode(" ", $msg);
if(preg_match("/^\\d+$/", $amount))
echo "valid amount!";
else
echo "invalid amount";
Hope this helps. Cheers
精彩评论