Unterminated entity reference in PHP

后端 未结 7 1295
遥遥无期
遥遥无期 2021-02-02 06:06

Here is my code:

\');
$pro         


        
7条回答
  •  日久生厌
    2021-02-02 06:40

    SimpleXMLElement is actually a system resource which behaves like an object. Which makes working with loops tricky. So when trying to add new child elements instead of this:

    $product->addchild('element', $value);
    

    do this:

    $product->element = $value;
    

    or you can use htmlspecialchars(), to escape html characters.

    Note:

    mysql_* is deprecated as of php-5.5 and removed as of php-7. So instead use mysqli_* or PDO.
    Why shouldn't I use mysql_* functions in PHP?

提交回复
热议问题