A
A
apbltgfteymrnp2021-01-17 22:53:57
PHP
apbltgfteymrnp, 2021-01-17 22:53:57

Why can't I work with system() output?

Hello.

$sys = system("whois ".$_GET['ip'].' | sed \'s/$/\delimiter/\''); //оно успешно заменяет \n на delimiter, \n - не хотел эксплодиться дальше вообще, но и делимитер как оказалось тоже
print_r(explode('delimiter', $sys));

I want to parse the output in a script. And I get the output on the screen and Array ( [0] => [1] => )
php 7.1
thank you all!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
apbltgfteymrnp, 2021-01-17
@apbltgfteymrnp

Got it! in a panic created a question.
exec() gives just the same line-by-line output in an array and does not output anything permanently

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question