I'm writing this quick script to extract chatroom names from the source of a webpage. I'm grabbing the data with fopen() and fgets() and that all returns fine.
My regex is /#[a-zA-z]+/
, which does seem to work. However I can not get preg_match_all()
to return a concise list of data.
preg_match_all("/#[a-zA-z]+/", $contents, $foo, PREG_SET_ORDER);
foreach($foo as $item) print $item;
Returns "ArrayArrayArrayArrayArrayArrayArrayArray...".
print_r ($item);
Returns something along ( [0] => #channel1 ) Array ( [0] => #channe2 ) Array ( [0] => #channel3 )...
I'm unsure how to get this formated properly, any quick help?