Find the answer to your Linux question:
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 ";" ...
  1. #1
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226

    Question php unexpected T_AS, expecting ';'

    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 ";" in a for loop right?
    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

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,300
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...