Hi,
Code below doesn't work for a file contains HTML content? How do we solve this issue?
Result must be <span but it dispays blank screen.
Thanks in advance
Content of index.txt
<span class="mw-headline" id="Zero"><a href="/wiki/Zero" title="Zero">Zero</a></span></h2>
PHP to read the file
<?php
$handler = fopen('index.txt','r');
while ($line = fgets($handler))
{
echo substr($line, 0, 4); exit;
}
fclose($handler)
?>