Advertisement
Guest User

Untitled

a guest
Jun 29th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. // Requête SQL de base
  4. function requete($requete)
  5. {
  6. $requete = mysql_query($requete) or die(mysql_error());
  7. $requete = mysql_fetch_array($requete);
  8.  
  9. return $requete;
  10. }
  11.  
  12. // HTMLentities UTF-8/ISO
  13. function htmlentities_isoutf8($text, $encodage)
  14. {
  15. if ($encodage)
  16.     {
  17.     $text = htmlentities($text, ENT_COMPAT, 'UTF-8');
  18.     }
  19. else
  20.     {
  21.     $text = htmlentities($text);
  22.     }
  23. return $text;
  24. }
  25.  
  26. // utf8_decode UTF-8/ISO
  27. function utf8_decode_isoutf8($text, $encodage)
  28. {
  29. if ($encodage)
  30.     {
  31.     $text = utf8_decode($text);
  32.     }
  33. return $text;
  34. }
  35.  
  36. // Encode un tableau en UTF-8
  37. function array_enc_utf8(&$valeur)
  38. {
  39. $valeur = utf8_encode($valeur);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement