BBB.txt file.... but the problem is while storing parsing content it is storing in one line and not one
below the other.
consider that $_SESSION['pdb'] is title.txt file....
title.txt file
COMPND MOL_ID: 1;
COMPND 2 MOLECULE: DNA/RNA (5'-R(*CP*)-D(*CP*GP*GP*CP*GP*CP*CP*GP*)-
COMPND 3 R(*G)-3');
COMPND 4 CHAIN: A, B;
COMPND 5 ENGINEERED: YES
TITLE CRYSTAL STRUCTURE OF THE HIGHLY DISTORTED CHIMERIC DECAMER
TITLE 2 R(C)D(CGGCGCCG)R(G)-SPERMINE COMPLEX-SPERMINE BINDING TO
TITLE 3 PHOSPHATE ONLY AND MINOR GROOVE TERTIARY BASE-PAIRING
Code: Select all
<p id='atom'><a href='download.php'>TITLE_Download</a></p>
<?php
session_start();
?>
<?php
$_SESSION['']="";
$str='';
$line='';
$files = $_SESSION['pdb'];
$afile=explode("\n",$files);
foreach($afile as $line)
{
if (preg_match('/^TITLE.*.$/',$line))
{
?>
<html>
<table border="0" bgcolor="navyblue">
<tr><td><?php echo "<pre>$line"?></td></tr>
</table>
</html>
<?PHP
$str.=$line;
}
}
unset($line);
file_put_contents('BBB.txt',$str);
?>