Sajidur Rahman Sajidur Rahman - 20 days ago 5
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


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";