ID of POST, GET, COOKIE or SESSION - Validation


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $id = abs(intval($id)); // only positiv and complete id's
  2.  
  3. if(!isset($id) or empty($id) or is_array($id)) {
  4. return false;
  5. }
  6.  
  7. $id = 3; // return true
  8. $id = [] // return false
  9. $id = '' // return false

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.