PHP pathinfo Functon Example

Folder Structrue:


fileinfo.php

<!DOCTYPE html>
<html>
<head>
<title>Web Application</title>
</head>
<body>
<?php 
print '<pre>';
$filePath = '/fileimage/jobs.jpg';
$fileinfo = pathinfo($filePath);
print_r($fileinfo);
print '<hr/>';
print_r($fileinfo['basename']);
$path= 'fileimage/'.$fileinfo['basename'];
print '<br/>';
print "<img src='$path' width='100px'/>";
?>
</body>

</html>

Output 1



Output 2







Share on Google Plus

About Ram Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment