PHP Parse Question
I am trying t开发者_高级运维o edit a link image.
http://site.com/image.jpg
I would like it to be http://site.com/tn-image.jpg
I want to add the tn- with php. How can I accomplish this? Thank you.
You can use dirname in conjunction with basename to alter a path.
<?php
$path = "http://site.com/image.jpg";
echo dirname($path).'/tn-'.basename($path);
Test it.
精彩评论