never mind it

i've solved it trimming the $replace and $replacement before using them in
ereg_replace()

thanks anyway


"Michiel Van Heusden" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i'm creating sort of a very simple css-alike-thing for outputting html to
> flash actionscript.
> the php gets a string ($text) from the database, which look something
like:
> <h1>header 1 </h1> etc...
>
> then, from a 'css' file it reads the strings $replace and $replacement
>
> it looks something like:
>
>    $number = count($arr_replace);
>    $i = 0;
>
>    do {
>
>        $replace = stripcslashes($arr_replace[$i]);
>        $replacement = stripcslashes($arr_replace[$i]);
>
>        $text = ereg_replace($replace, $replacement, $text);
>
>        $i++;
>
>    } while ($i < $number);
>
> this works fine, except that after the ereg_replace some newlines are
> inserted. I could strip them, but then i'm also stripping the original
> newlines (which were in the string already) so, i'd be happier finding a
way
> of using this script without ereg_replace inserting newline (i don't
> understand why it does anyway)
>
> any suggestions?
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to