Aptalca bir soru, bu kodu:
<?php
$variable = system("cat /home/maxor/test.txt");
echo $variable;
?>
dosya test.txt ile:
blah
yazdırır:
blah
blah
Ben bu yüzden 1 "blah" olsun hiçbir baskı değil sistemi () fonksiyonu ile ne yapabilirim??
Kılavuzuna göre - bkz system() :
system()is just like the C version of the function in that it executes the given command and outputs the result.
Ilk blah açıklıyor
And :
Returns the last line of the command output on success
İkinci blah açıklıyor - Ve sen döndürülen değeri yankılanıyor.
If you want to execute a command, and get the full output to a variable, you should take a look at exec, or shell_exec.
İlki size bir dizi (see the second paramater) için tüm çıktı satırları alacak; ve ikinci bir bir dize olarak size tam çıkış alırsınız.