Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '{' or '$'

admin

Administrator
Staff member
From this <a href="http://simplehtmldom.sourceforge.net" rel="nofollow">Simple Dom Site</a>

Code:
if(isset($html-&gt;'div#sidebar')) 
{
    $sidebarFile = 'D:\xampp\htdocs\final\wordpress\sidebar.php';
    $openSidebarFile = fopen($sidebarFile,'a');
    foreach($html-&gt;find('div#sidebar')) as $e)
    {
        $html -&gt;find('div[id=sidebar]', 0) -&gt; innertext;
        $inputSidebar = $e-&gt;outertext;
        fwrite($openSidebarFile, "\n" .inputSidebar "\n");
    }
}

From the documentation:
it says:

Code:
// Determine whether a attribute exist? 
if(isset($e-&gt;href)) 
        echo 'href exist!';