开发者

validate function for special characters for prescribed data in url in php , CodeIgniter

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜