Creating a php file using php File Write
<p>I tried to create a php file  and save it in a root directory but it give error while doing it </p>

<blockquote>
  <p>Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE),
  expecting identifier (T_STRING) or variable (T_VARIABLE) or number
  (T_NUM_STRING) in C:\xampp\htdocs\page\cjl\configAlter.php on line 181</p>
</blockquote>

<p>here is my code</p>

<pre><code>&lt;?php
$IndexFile = 'default.php';
$IndexCont = "&lt;?php
session_start();
$currentBas = basename(dirname(__FILE__));
$parentBas = basename(dirname(dirname($_SERVER['SCRIPT_NAME'])));//Line 181
$DIR = __DIR__;
require('../../srcc/default.php');
?&gt;";
//This is already define $parentDir."".$SubFolderjailorgname
$fileDirectoryR = $parentDir."".$SubFolderjailorgname;
$myReadfile = fopen($fileDirectoryR.'/'.$IndexFile, "w") or die("Failed to open file!");
fwrite($myReadfile, $IndexCont);
fclose($myReadfile);
//END CREATE TEXT TO FILE
?&gt;
</code></pre>