Page 1 of 1

Posted: Tue Nov 12, 2002 2:33 pm
by Oleg Butuzov
i did not unerstud what you want to do ...

you want to edit doc file - it is imposible...

if you want to edit simple plain/text file you need read more about regular expresions
for exemple...

Code: Select all

$message=str_replace("[TONAME]", $name, $message);


Where [TONAME] - is patern

read more at http://www.php.net

Posted: Wed Nov 13, 2002 10:24 am
by DanD
No, that was not the question because I have the
same problem...

this is the text line:

d:\documents\test.doc

The actual question is to search for the first " \"
from the right and display the text after the first
founded " \".

Then I would ask for how to add this in a loop ?

This is realy hard for me to do. I want to display
the list of downloads of our site but just the name.
not the complete url.

Posted: Thu Nov 14, 2002 3:40 am
by Oleg Butuzov
ok... I understend you.

this is another way how to do it...

Code: Select all

$file = file("downloads.txt");
$countdownloads=count($file);

for ($i=0; $i < $countdownloads; $i++)
{
$srting=explode ("\\", $file[$i]);
$filename=count($string)-1;
echo "$string[$filename]<br>\n";
unset($string);
}