Hai I have a link like http://www.xyz.com/vol/vol04/justborn/home.htm from which i should extract home.htm and append a file test.txt say http://www.vikatan.com/vol/vol04/justborn/test.txt
how can i achieve it
URGENT.
Bye
use something like strrchr to find the position of the last "/" in the string, and then use substr to grab everything leading up to that postion.
then you can concat "test.txt" to it.
Hi, Try this... it should work...
$content="http://www.xyz.com/vol/vol04/justborn/home.htm"; $st=eregi("(.)/(.)?", $content, $output); now in $output[1] u will get... $output[1]="http://www.xyz.com/vol/vol04/justborn" now u can concatanate "/test.txt" $finalstring=$output[1]."/text.txt";
and so u will get the final desired output...
hope this has solved ur problem.. Shaju