The PHP 5.2 filter_var Function PRO

PHP 5.2 adds the filter_var function. It is an important function that assists with validating the user input.

<?php
$email_address_dirty = "haim.michael@gmail.com";
if(filter_var($email_address_dirty,FILTER_VALIDATE_EMAIL))
{
    $email_address_clean = $email_address_dirty;
}
echo $email_address_clean;
?>

The following video clip shows the execution of this code sample and explains it.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences