Système de fichiers
basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space diskfreespace disk_total_space fclose feof fflush fgetc fgetcsv fgets fgetss file file_exists fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fopen fpassthru fputs fread fscanf fseek fstat ftell ftruncate fwrite set_file_buffer is_dir is_executable is_file is_link is_readable is_writable is_writeable is_uploaded_file link linkinfo mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink rename rewind rmdir stat lstat realpath symlink tempnam tmpfile touch umask unlink
Description
array pathinfo(string path )
pathinfo retourne un tableau associatif, contenant les informations sur le chemin path. Les éléments suivants sont retournés : dirname, basename et extension.
<?php $path_parts = pathinfo("/www/htdocs/index.html"); echo $path_parts["dirname"] . "\n"; echo $path_parts["basename"] . "\n"; echo $path_parts["extension"] . "\n";?>
Va afficher :
/www/htdocsindex.htmlhtml
Voir aussi dirname, parse_url, basename et realpath.