i wanted to replace the following
lets say string looks like this
/word/number/number.doc
this should become
number.doc
the first i dont have troubles with.
the first number i do.. since this is not always the same
i tried replacing /%/ and /*/ neither of them seemed to work.
[SOLVED ] str_replace
Moderator: General Moderators
[SOLVED ] str_replace
Last edited by ol4pr0 on Tue Sep 07, 2004 6:57 pm, edited 1 time in total.
dont need replace.
Code: Select all
<?php
$string = "/word/number/number.doc";
$array = explode("/", $string);
$string = $array[sizeof($array)-1];
?>