<?php $file = file('strings.txt'); foreach($file as $index => $str) print $index." ".$str; print count($file); ?>