i need to reveive all words in text file after : i started to write this code for example i need to receive frisco415 : text file: :frisco415 :friekiegee :linkage9 <?php $filename="w.txt"; $content=file($filename); foreach($content as $line) { //echo $line."<br>"; $linew= split(":",$line); //print_r($linew); for($i=0;$i<count($linew);$i++){ echo $linew[$i]"<br>"; } } ?>
As long as there won't be any usernames with : you would be pretty save doing this <?php $filename="w.txt"; $content=file($filename); foreach($content as $line) { $linearray = explode(":",$line); if (isset($linearray[1])) { echo $linearray[1].'<br/>'; } } ?> PHP: