Posted By

nicolaspar on 07/12/06


Tagged

get php post


Versions (?)

Php Levantar variables beta 0.1


 / Published in: PHP
 

  1. define("INT",0,1);
  2. define("VARCHAR",1,1);
  3. define("TEXT",2,1);
  4. #Ejemplos:
  5. #echo levantar($_GET["variable"], varchar, 'hola');
  6. #$variable = levantar($_GET["variable"], int, 0 );
  7. function levantar(&$str,$tipo=1,$default='',$upper=0){
  8. $return = '';
  9. if(isset($str)):
  10. if($tipo==1):
  11. $return = limpiar($str);
  12. elseif($tipo==2):
  13. $return = limpiarHTML($str);
  14. else:
  15. $return = intval($str);
  16. endif;
  17. else:
  18. $return = ($tipo==0) ? (is_numeric($default)) ? $default : 0 : $default;
  19. endif;
  20.  
  21.  
  22.  
  23. return $return;
  24. }

Report this snippet  

You need to login to post a comment.