Manuel PHP

SplFileInfo::getPath

(PHP 5 >= 5.1.2)

SplFileInfo::getPathGets the path without filename

Description

public string SplFileInfo::getPath ( void )

Returns the path to the file, omitting the filename and any trailing slash.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Returns the path to the file.

Exemples

Exemple #1 SplFileInfo::getPath() example

  1. <?php
  2. $info = new SplFileInfo('/usr/bin/php');  
  3. var_dump($info->getPath());  
  4.  
  5.  
  6. $info = new SplFileInfo('/usr/');  
  7. var_dump($info->getPath());?> 

L'exemple ci-dessus va afficher quelque chose de similaire à :

string(8) "/usr/bin" string(4) "/usr"


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique