<?php
if (!preg_match("/^(http(s?)://|ftp://{1})
((w+.){1,})w{2,}$/i", $websitrAddres))
$errorList[]="Invalid Website address. ' ";
?>
<?php
$array = array('this', 'is', 'an array');
echo is_array($array) ? 'True' : 'False'; // True
echo " ";
$var = 'this is a string';
echo is_array($no) ? 'True' : 'False'; // False
?>
<?php
$testString = "FirstName,MiddleName,LastName";
$testArray = split(",",$testString);
print_r($testArray);
//Array ( [0] => FirstName [1] => MiddleName [2] => LastName )
?>
<?php
$testString = "FirstName MiddleName,LastName";
list($first, $middle, $last) = split('[ ,]', $testString);
echo "First Name: $first; MiddleName: $middle; LastName: $last";
?>
<?php
$email = 'firstname@mail.com';
$domain = strstr($email, '@');
echo $domain; // prints@mail.com
?>
<?php
echo substr('abcdef', 1, 3);
// bcd
?>
<?php
$number = 5030;
echo number_format($number);
// 5,030
?>
<?php
$number = 5030;
echo number_format($number);
// 5,030
?>
<?php
echo chr(50).",";
echo chr(55).",";
echo chr(53);
?>
<?php
echo rtrim("Test "); // Test
//Will remove the spaces from the end
?>
<?php
echo ltrim(" Test"); // Test
//Will remove the spaces from the beginning
?>
Zend | Magento Certified PHP | eCommerce Architect