Source Code:
(back to article)
<?php $path = '/var/www/html/index.php'; $info = pathinfo($path); echo $info['dirname'] .PHP_EOL ; // Output: /var/www/html echo $info['basename'] . PHP_EOL; // Output: index.php echo $info['extension'] . PHP_EOL;// Output: php echo $info['filename']; // Output: index
Result:
Report an issue