InterviewSolution
| 1. |
How To Get The Directory Name Out Of A File Path Name? |
|
Answer» If you have the full path NAME of a file, and WANT to get the directory name portion of the path name, you can USE the dirname() function. It BREAKS the full path name at the last directory path delimiter (/) or (\), and returns the first portion as the directory name. Here is a PHP script example on how to use dirname(): If you have the full path name of a file, and want to get the directory name portion of the path name, you can use the dirname() function. It breaks the full path name at the last directory path delimiter (/) or (\), and returns the first portion as the directory name. Here is a PHP script example on how to use dirname(): |
|