I want to know how can i use python to search and into mysql of my PHP Laravel project and send back the results into php file
Advertisement
Answer
Its not complicated, See link blow : https://laracasts.com/discuss/channels/laravel/running-python-in-laravel
The Laravel Script :
JavaScript
x
// $json = an encoded JSON string
$process = new Process("python3 /Path/To/analyse_json.py {$json}");
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
dump(json_decode($process->getOutput(), true));