But... it seems to me there is no way to do this in ONE step:
Create an array and have one element returned as a string.
in Java / JavaScript you can simply append the desired elements index to the function creating the array like this:
Code: Select all
var myFilename = myFileWithExtention.slice('.')ї0];Code: Select all
$tmp = explode('.', $myFileWithExtention);
$myFilename = $tmpї0]For example:
With an image file upload, you can determine the image type by calling getimagesize() on the file. The image type information is in the 3rd element of the array returned.
Now it would be so nice to code:
Code: Select all
$image_format = getimagesize($ul_file)ї2];Please tell me that I am just plain blind and that, of course, there is a way to do this in PHP!
Thanx!