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
Create directory function...Create directory if not exists.
function createDir( $dir )
{
if ( !is_dir( $dir ) ) {
mkdir( $dir, 0777 );
return true;
}
return false;
}...
Random string generator...Random string generator. Optionally, you can give it a desired string length.
function rnd_string($len = 24)
{
$str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str...
Resize image function...Resize image function for jpg format. $mood between max and min. if you choose max, this mean max size of image is $ta otherwise min size of image is $ta.
function makeTheThumb( $ppath, $ta, $mood )
...
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);...