You should probably be using strtr() for this.

Anyway, questions about developing WITH PHP should go to the php-general
list, instead of php-dev (which is for developing PHP itself).

Regards,

Manuzhai

"Izx" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi ppl,
>
> $xarray=('ab', 'ba');
> $xsearch=array('a', 'b');
> $xreplace=array('c', 'd');
> $xarray=str_replace($xsearch, $xreplace, $xarray);
>
> str_replace used this way fails, returning $xarray unmodified. However:
>
> $xarray=str_replace(array('a', 'b'), array('c', 'd'), $xarray);
>
> works OK.
>
> Any solutions why str_replace doesn't work with externally defined arrays?
>
> TIA,
> izx
>
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to