This is a really easy question, but I can’t figure out what I should be using exactly.
My $image['url'] is http://hello.com/uploads/2012/name.jpg
So I want to just be left with this… name.jpg
I tried lots but I think explode is the one I should use but I just get array outputted from this.
$filename = explode('/', $image['url']);
echo $filename;
Can anyone please point me in the right direction on the php manual.
Thank you.
Your code was mostly right, just lacking an array_pop() to extract last element of array returned by
explode(), like this: