Hello,
I use a javascript ticker in my header which contains the news in a array
like that
tickercontents[0]='Message1'
tickercontents[1]='Message2'
tickercontents[2]='Message3'
now i want to write an easy script that i can run from my server to change
the message and
was thinking about something like that
$replacement = 'New Message1';
$file = "header.htm l";
$fh = fopen($file,"r" ) or die("can't open file");
$file = fread($fh, filesize($file) ) or die("can't read file");
$replaced =
ereg_replace("( tickercontents\[0\]\=)(')(.*)(')", "\\1\\2$ersatz\ \4",$file1)
or die("can't do that sorry");
..........
the only problem is ereg_replace in not stopping at the end high coma in
message1 it stops at the end high coma of message3.
I there a way to make it stop after the first one.
I appreciate any thoughts
Thanks
chris
I use a javascript ticker in my header which contains the news in a array
like that
tickercontents[0]='Message1'
tickercontents[1]='Message2'
tickercontents[2]='Message3'
now i want to write an easy script that i can run from my server to change
the message and
was thinking about something like that
$replacement = 'New Message1';
$file = "header.htm l";
$fh = fopen($file,"r" ) or die("can't open file");
$file = fread($fh, filesize($file) ) or die("can't read file");
$replaced =
ereg_replace("( tickercontents\[0\]\=)(')(.*)(')", "\\1\\2$ersatz\ \4",$file1)
or die("can't do that sorry");
..........
the only problem is ereg_replace in not stopping at the end high coma in
message1 it stops at the end high coma of message3.
I there a way to make it stop after the first one.
I appreciate any thoughts
Thanks
chris
Comment