RSS
 

Archive for the ‘PHP’ Category

Php Shuffle – mélanger un tableau (array)

30 Aug

Shuffle est un mot anglais qui signifie mélanger. En php, c’est aussi un mot-clé pour une fonction qui prend un tableau en entrée, mélange ses éléments et retourne TRUE en cas de succès et FALSE si une erreur survient.

Utilisation

Cette fonction est utile si vous souhaitez afficher aléatoirement des informations sur votre site web par exemple.

Continue reading “Php Shuffle – mélanger un tableau (array)” »

 

Php function – check if characters in a string are numerical

23 Feb

I was looking for a way to check if a string contained only numerical values.  I thought that the php function is_numeric() would do the job. I was wrong.

  1. echo is_numeric(555); // 1
  2. echo is_numeric(55.55); // 1
  3. echo is_numeric(+55.55); // 1
  4. echo is_numeric(-55.55); // 1
  5. echo is_numeric(-+55.55); // 1

Facebook ids (for developers)

Continue reading “Php function – check if characters in a string are numerical” »

 

Facebook Email Validation not optimum

18 Jan

I came across this problem while trying to add an email with a .info extension to the list of emails authorised on Facebook. I was unable to do so. I logged out and tried signing up with an email with a .info extension and once again I got the following message:

Please enter a valid email address.

Continue reading “Facebook Email Validation not optimum” »

 
 

Get current Php version

04 Nov

I was looking for a way to get the current php version and I finally found the solution on the official php website. Continue reading “Get current Php version” »

 

Email validation with filter_var – php 5.2.0

12 Sep