如何与swi-prolog程序交互,就像我使用cmd而不是我使用PHP代码

I want to get outputs and write inputs to a swi-prolog program I made.

Is there a way I can do that using PHP?

When I run swi-prolog in windows you can interact with prolog, write commands so it opens files, and do more things. Is there a way I can interact with swi-prolog that way using PHP?

I tried swipl -s file.pl -g "funtion(). s." -t halt; but it doesn´t let me write inputs.