Sample code for 30+ languages & platforms
PHP

Get the Target of a Symbolic Link

See more FileAccess Examples

Demonstrates how to get the target of a symbolic link.

Note: This example requires Chilkat v9.5.0.77 or greater.

Chilkat PHP Downloads

Chilkat2 PHP
<?php

use Chilkat2\FileAccess;

$fac = new FileAccess();

try {
    $targetPath = $fac->SymlinkTarget('qa_data/my_symlink');
} catch (\Chilkat2\Exception $e) {
    echo "Failed to get symlink target.\n";
    exit;
}

echo 'target path = ', $targetPath, "\n";