PHPascal.com

PHPAscal rouge2 (Version bleu)


Programmation web CSS HTML PHP Jquery Javascript Wordpresse RSS SQL SSH, serveur linux Outils
  PHPascal a 147 articles


Recherche


cheap nike nfl jerseysWholesale cheap nfl jerseyscheap jerseys online from chinacheap nfl jerseys free shippingwholesale nba jerseysWholesale cheap nhl jerseyscheap nhl jerseys onlinecheap nba basketball jerseys

Valid HTML 5

Programmation web / PHP / Fonction php pour trouver l'extention d'un fichier

Fonction php pour trouver l'extention d'un fichier

Voici une toute petite fonction toute simple pour permettre facilement de récipérer l'extention d'un fichier via PHP.

/**
 * Trouver l'extention d'un fichier
 *
 * Exemple : repetroire_1/fichier.jpg  ->  jpg
 *
 * @link http://www.phpascal.com/programmation-web/PHP/trouver-extention-fichier.html
 *
 * @param $nom_fichier nom du fichier avec ou sans le chemin (repertoire)
 * @author Pascal
 * @since Fri Jun 10 01:54:37 GMT 2011
 * @return string
 */
function trouver_extention($nom_fichier)
{
 
    $list = explode(".", $nom_fichier);
     $ext = end($list);
 
    return strtolower($ext);
      
}
Article écrit le 9 juin 2011
Article modifié le 7 juillet 2011

Autres articles sous la même catégorie


Pascal Dubreuil | © PHPascal.com 2024
Temps d'exécution : 0.0051 sec
Imprimer le 28 March 2024 - 18:15:38
par Pascal Dubreuil organisateur du Marathon roller du Canada