Tuesday, 15 March 2011

search from txt php multiple line with same value -



search from txt php multiple line with same value -

php

<?php $input = $_post['name']; // $input word beingness supplied user $handle = @fopen("somefile.txt", "r"); if ($handle) { while (!feof($handle)) { $entry_array = explode(";",fgets($handle)); if ($entry_array[0] == $input) { echo $entry_array[1]; homecoming $entry_array[1]; } } fclose($handle); } homecoming null; ?>

somefile.txt

a;hello a;hello2 a;hello3 b;hello4 c;hello5

no when type a, shows first 1 "hello", should create read a; hello&hello2&hello3. im trying do.

why returning after echo $entry_array[1];? ends while-loop

php

No comments:

Post a Comment