This way useful for create mixed arguments function.
function foo()
{
$args = func_get_args();
print_r($args);
}
foo(1, 1256, 6, 17); //mixed ...
-------------------Out----------------------
Array
(
[0] => 1
[1] => 1256
[2] => 6
[3] => 17
)Tags
No tag here. Recommended pages
Detect file extension function...This function is used to find the file extension also you can use pathinfo() function for get information about a file path.
function ext($file_name)
{
return substr($file_name, strrpos($fi...
Delete file function...If file exists then delete the file.
function delFile( $file_name )
{
if ( file_exists( $file_name ) ) // Does '$file_name' exist
{
unlink( $file_name );
return true;
}
...
Email Address Checker...This function check if an e-mail address is valid or not.
function valid_email($email)
{
return preg_match('/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/',
$email);...
Validate phone number...Chek if a phone numbers is valid, according to its syntax (should be: "+390523599314"). True if it's valid, False otherwise
function is_valid_phone( $phone )
{
if ( $phone[0] != "+" ) {
...