SplFileInfo::getLinkTarget

Gets the target of a link

&reftitle.description; public ``string``false```SplFileInfo::getLinkTarget`

Gets the target of a filesystem link.

The target may not be the real path on the filesystem. Use `SplFileInfo::getRealPath` to determine the true path on the filesystem.

&reftitle.parameters; &no.function.parameters;
&reftitle.returnvalues;

Returns the target of the filesystem link on success, or &false; on failure.

&reftitle.errors;

Throws `RuntimeException` on error.

&reftitle.examples;

### `SplFileInfo::getLinkTarget` example

    <?php
    $info = new SplFileInfo('/Users/bbieber/workspace');
    if ($info->isLink()) {
        var_dump($info->getLinkTarget());
        var_dump($info->getRealPath());
    }
    ?>

&example.outputs.similar;

    string(19) "Documents/workspace"
    string(34) "/Users/bbieber/Documents/workspace"

&reftitle.seealso;

- `SplFileInfo::isLink`
- `SplFileInfo::getRealPath`