|
Posted by Vince Morgan on 04/25/07 13:57
"Vince Morgan" <vinhar@REMOVEoptusnet.com.au> wrote in message
news:462f5a86$0$5745$afc38c87@news.optusnet.com.au...
> "ana" <anka@vizualmedia.hr> wrote in message
> news:f0n5jp$er$1@ss408.t-com.hr...
> > I'm not very good programer, I use one php script for cms for flash.
> > When I make changes in text in this CMS, for example I put letters bold,
> > this script puts <strong></strong> on beginning and the end, but I need
> > <b></b> so I use str_replace to replace strong with b, and this is ok.
> >
> > But when I change a color, this script puts for example <font
> color=#CCCCCC>
> $pos[0]=stripos($f, 'font-color=#', $pos[0]);
Steves aproach is far superior. And the line above should be as below
anyway to account for possible spaces.
$pos[0]=stripos($f, 'font-color', $pos[0]);
> $pos[1]=stripos($f, '=', $pos[0]);
> $f=substr_replace($f, '="',$pos[1], 1);
> $pos[0]=stripos($f, '>', $pos[1]);
> $f=substr_replace($f, '">', $pos[0], 1);
Navigation:
[Reply to this message]
|