Edit: this is part of main function to call the grab function:
$video['type'] = $videoProvider;
$video['id'] = $videoIds;
$video['title'] = $this->grab_title_from_curl($data);
I have this little function to parse title from html via curl, it works.
private function grab_title_from_curl ($pull){
preg_match("/<meta name=\"title\" content=\"(.*?)\"/", $pull,$data) ;
return $data;
}
and shows me this:
Array
(
[type] => yahoo
[id] => 613478/2923165
[title] => Array
(
[0] => EXELENTE TIRO DE ARCO!!
)
)
I need to [title] directly gets the value of [0] in the array. like: [title] => EXELENTE TIRO DE ARCO!!
second edit:
for some reason the code breaks when i use JoostK's code: pastie.org
sorry for my bad english!
SOLVED: instead of preg_match("/?)\"/", $pull,$data); preg_match('/?)\"/', $pull,$data) ;
$dataarray. Easiest but not most elegant way would be to use$array['title']=$array['title'][0];There may be better ways to do it, but then we need a bit more code.