[ create a new paste ] login | about

Link: http://codepad.org/kLl2yPMF    [ raw code | output | fork ]

PHP, pasted on Jan 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$path = '/here/someplace/somefile.jpg';

$withoutExt = pathinfo($path, PATHINFO_DIRNAME) . '/' . pathinfo($path, PATHINFO_FILENAME);

echo $withoutExt . "\n\n";

$path = 'somefile.jpg';

$withoutExt = pathinfo($path, PATHINFO_DIRNAME) . '/' . pathinfo($path, PATHINFO_FILENAME);

echo $withoutExt;


Output:
1
2
3
/here/someplace/somefile

./somefile


Create a new paste based on this one


Comments: