yanwong / ganon

Automatically exported from code.google.com/p/ganon
0 stars 0 forks source link

str_get_dom() error #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
$rt="<td>my name somebody</td>";
$html= str_get_dom($rt);
foreach($html('input[class]') as $element) {
    echo $element->class; 
}

line number 2 show s error 

Fatal error: Function name must be a string in 
/home/content/18/7124318/html/rkys/geL.php

Original issue reported on code.google.com by pradeep2...@gmail.com on 28 Mar 2012 at 8:10

GoogleCodeExporter commented 8 years ago
What version of PHP are you using?

Original comment by niels....@gmail.com on 28 Mar 2012 at 6:50

GoogleCodeExporter commented 8 years ago
It's PHP 5.2

foreach line show error 

Original comment by pradeep....@raweng.com on 29 Mar 2012 at 5:26

GoogleCodeExporter commented 8 years ago
Try using $html->select('input[class]') and $element->getAttribute('class').
This is because PHP 5.2 doesn't support the magic invoke method (see the last 
point of the PHP4 wiki page). Does this solve it for you?

Original comment by niels....@gmail.com on 29 Mar 2012 at 6:20

GoogleCodeExporter commented 8 years ago
should i have to download ganon.php for php 4

by the way $html->select work for me

Original comment by pradeep....@raweng.com on 29 Mar 2012 at 6:45

GoogleCodeExporter commented 8 years ago
No, the PHP 5 version should work if you explicitly call the functions.
If you're running into any other problems, please let me know!

Original comment by niels....@gmail.com on 29 Mar 2012 at 6:51