Results 1 to 2 of 2
so on the second line in this code snipit, it throws me an error saying:
Parse error : syntax error, unexpected T_AS, expecting ';'
But you don't need a ";" ...
- 02-23-2009 #1
php unexpected T_AS, expecting ';'
so on the second line in this code snipit, it throws me an error saying:
But you don't need a ";" in a for loop right?Parse error: syntax error, unexpected T_AS, expecting ';'
PHP Code:$diditname = false;
for ($xml->xpath('//name') as $name)
{
if($name == NULL && $diditname == false)
{
$name = $setuser;
$diditname = true;
}
}
$didutidnum = false;
for ($xml->xpath('//idnum') as $idnum)
{
if($idnum == NULL && $diditidnum == false)
{
$idnum = $ID;
$diditidnum = true;
}
}
file_put_contents($file, $xml->asXML());
"Do or do not...there is no try" -Yoda
History is a set of lies agreed upon by the winners.
Linux is user friendly, not idiot friendly.
Linux User 437442
- 02-23-2009 #2
foreach ($xml->xpath('//name') as $name)
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.


Reply With Quote