Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

php: array to string conversion



hi all.  in the middle of my script for scraping
bittorrent trackers i'm getting 'Notice: Array to
string conversion'.  i'm trying to use curl to get the
text from the tracker and then i want to extract the
desired text and update the database.  preg_match and
substr look like an easy way to get the digits but can
i not use them together?  i tried using settype but
keep screwing up.  thanks for any tips.  - eric c, the
one who sucks at programming but wants new toys.

...

// let's extract complete (seeds), downloaded and
incomplete (peers).
preg_match("<completei\d*>", $scrape_result,
$matches_complete);
preg_match("<downloadedi\d*>", $scrape_result,
$matches_downloaded);
preg_match("<incompletei\d*>", $scrape_result,
$matches_incomplete);

// get the substring of only numbers
$complete = substr($matches_complete, 9);
$downloads = substr($matches_downloaded, 11);
$incomplete = substr($matches_incomplete, 11);

...

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org