So I have this script that I'm trying to pass the argument via command line. But, can't get it to work. Here's the code for the script:
#!/usr/bin/php
<?php
$argv[1] = $scraper;
require_once('Scraper.php');
$scraper = new JonH_Scraper();
if (empty($argv[1])) {
echo 'whats the URL?';
}
$scraper->scrape($url);
var_dump($scraper);
the mistake is here
$argv[1] = $scraper;
it should be
$scraper = $argv[1];
regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With