Reply to Reading from txt file

Your name:

Reply:


Posted by FayeC on 11/29/05 18:37

I have the following code:
<?php
$username = $_POST['username'];
$myFile = "clientlist.txt";
$fp = fopen($myFile, 'r');
$content = fread( $fp, filesize( $myFile ) );
$inputString = $username;

$arrFp = file( $myFile ); // Open the data file as an array
$numLines = count( $arrFp ); // Count the elements in the array

$arrWords = explode( ' ', $inputString ); // Split the input string
into words as an array
$numWords = count( $arrWords ); // Count the words in the string

for($i=0; $i<$numWords; $i++) // Loop through the words in the string
{
for($j=0; $j<$numLines; $j++) // Loop through the lines of the
text file
$outputString .= $arrWords[$i].' ';
}
?>

And I need it to read a txt file that has something like:
user1="Smith"
user2="Macintosh"
user3="Hogan"

I need the outputString to be what is between the "" and not the
$username....
Right now it is outputting the same as the $username.
How do I change the code to select what is between the "" in the text
file?

Thank you for any help,

FayeC

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация