|
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
Navigation:
[Reply to this message]
|