Here is a function to format
function format_currency($curr){
$formated_value = number_format($curr, 2, '.', ',');
return $formated_value;
}
Tips and helps for my fellow PHP programmers.Here we are bound to build a PHP world.Anyone is welcome to share thier knowledge in PHP with others.Lets share and grow together
Thursday, January 18, 2007
PHP function to get extension of a file
Here is a simple usefull function to get extension of a file
function getFileExtension($filename){
$dot = substr (strrchr ($filename, "."), 1);
return ($dot);
}
function getFileExtension($filename){
$dot = substr (strrchr ($filename, "."), 1);
return ($dot);
}
PHP function see if url exists
Here is an simple usefull function see if an url exists
function url_exists($url)
{
$handle = @fopen($url, "r");
if ($handle === false)
return false;
fclose($handle);
return true;
}
function url_exists($url)
{
$handle = @fopen($url, "r");
if ($handle === false)
return false;
fclose($handle);
return true;
}
Subscribe to:
Posts (Atom)