Sajidur Rahman Sajidur Rahman - 1 year ago 83
HTML Question

can't write a file properly using php

$CreateFile = fopen("allinfo.html","a") or die("unable to create file");
$up = "<div class="infofilediv">";

When I creating this html file I can't write "infofilediv" this class. How can I solve this?

sorry for my bad english

Answer Source

you have two problem first with double-quotes here:

$up = "<div class="infofilediv">";

you can solve it by two ways :

1) use double-quotes first time and single-quotes second vise versa like this :

$up = "<div class='infofilediv'>";

2) escape double-quotes in second time like this :

$up = "<div class=\"infofilediv\">"; 

second with $ before function


replace with


$ use with variables

$hello="hello world";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download