Hey I have a problem with Simple DOM parser which is driving me nuts.
This works OK:
foreach($html->find('input[name=sex]') as $e)
echo $e->value;
Even if its only 1 result.
However this doesn't work:
echo $html->find('input[name=sex]')->value;
I don't want really use foreach because I expect only 1 result. So someone could help me with second block of code?
Cheers
->find()returns a results object, which can be boiled to an array of matching elements. You're doing->valueon the whole array, instead of one of the actual elements.