Reply to Re: Fonction STR_REPLACE

Your name:

Reply:


Posted by p.lepin on 09/01/06 15:00

alexandre.suc@gmail.com wrote:

First of all, this is an English-speaking newsgroup. Do not
expect answers speaking in any other language (you *could*
get an answer, just don't *expect* one; there's also a
significant drop in your chances to get a *helpful*
answer).

> Je désire utiliser un str_replace sur une variable qui
> contient le résultat d'une commande system().
>
> Bizarrement le STR_REPLACE semble sans effet

There's nothing really 'bizarrement' about that. If only
you had read the docs, you would notice that system() is
described as follows: 'system -- Execute an external
program and display the output'.

> exemple de mon code
>
> $entree = system('ls') ;
> $sortie = str_replace(".php","",$entree) ;
> echo $sortie
>
> Une idée du pourquoi ?

See above.

Okay, what you need is backticks.

$entree = `ls` ;

Next time, read the docs. There is even a French version of
PHP Manual if you want convenience, although I would advise
against using that.

--
Pavel Lepin

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация