I have never used rust but I have done something similar with PHP and C.
What you want to do is making your rust program accepts command line arguments, so you can do something like this
./executable string # where executable is your compiled rust program and string is the argument
now you capture that string argument and pass it to what ever function you want, refer to this documentation
Since your rust program is able to accept console argument, you can call the binary using PHP and pass console arguments, in others words you will be able to pass that string to the rust binary via PHP, like so:
$argument = "string"; // this is the console argument that rust binary will take
exec('/path/to/rust/binary ' . $argument . ' 2>&1', $output); # and you will have the output of the execution saved in the $output variable
Hopefully the idea is clear.