RSS
 
Share on Myspace

Archive for the ‘PHP’ Category

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

Content

  1. filter_var
  2. Examples using filter_var to validate an email
  3. Tweak for emails without a domain extension
  4. Examples with the emailValidation function
  5. Limits
  6. Conclusion
  7. Solution with a regular expression
  8. Php Email Validation function

Continue reading “Email validation with filter_var – php 5.2.0” »