I'm still very new to PHP so sorry if this seems simple to some people.
So I have a PHP Script that I would like to run, however when I run the script the variable in the script doesn't get executed. I'm using php's exec function.
<?php
$url = $_POST['url'];
echo exec('youtube-dl \--extract-audio \--audio-format \mp3 \$url 2>&1', $output);
print_r($output);
?>
Everything seems to work, however the $url
variable never gets inserted and the script returns with the error "We could not find a video by the URL of $url"
Now if I type "echo $url;"
it echos the url like normal.
Any ideas as to why this wouldn't work in the exec command? All help would be greatly appreciated!! Thanks in advance!!!