SplFileInfo::getPath

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::getPathObtém o caminho sem o nome do arquivo

Descrição

public SplFileInfo::getPath(): string

Retorna o caminho para o arquivo, omitindo o nome do arquivo e qualquer barra no final.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Retorna o caminho para o arquivo.

Exemplos

Exemplo #1 Exemplo de SplFileInfo::getPath()

<?php
$info
= new SplFileInfo('/usr/bin/php');
var_dump($info->getPath());


$info = new SplFileInfo('/usr/');
var_dump($info->getPath());?>

O exemplo acima produzirá algo semelhante a:

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

Veja Também

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top