This is a discussion on How to pick a specific row in a file? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello.. Lets say I want to pick row number #3 in text.txt. $row[] = file['text.txt']; How to do ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
"Roger Saarva" wrote:
> Hello.. > > Lets say I want to pick row number #3 in text.txt. > > $row[] = file[’text.txt’]; > > How to do now..? > > Thanks alot in Advance. $row[2] is the element you are looking for. One less than 3 since the array is zero-based. -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbForumz.com/PHP-pick-spe...ict135280.html Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=451807 |
|
|||
|
steve spilled the following:
> "Roger Saarva" wrote: > > Hello.. > > > > Lets say I want to pick row number #3 in text.txt. > > > > $row[] = file[’text.txt’]; > > > > How to do now..? > > > > Thanks alot in Advance. > > $row[2] is the element you are looking for. One less than 3 since the > array is zero-based. > Nope - coz he assigned the array of lines to the next free elemnt in the array - using the code above, the OP really wants $row[*something*][2]... I expect he really meant to write: $row=file('text.txt'); C. |
|
|||
|
"Colin McKinnon" <colin.thisisnotmysurname@ntlworld.deletemeunlessU RaBot.com> skrev i meddelandet news:YoWOc.418$E25.268@newsfe3-gui.ntli.net... > steve spilled the following: > > > "Roger Saarva" wrote: > > > Hello.. > > > > > > Lets say I want to pick row number #3 in text.txt. > > > > > > $row[] = file['text.txt']; > > > > > > How to do now..? > > > > > > Thanks alot in Advance. > > > > $row[2] is the element you are looking for. One less than 3 since the > > array is zero-based. > > > > Nope - coz he assigned the array of lines to the next free elemnt in the > array - using the code above, the OP really wants $row[*something*][2]... > > I expect he really meant to write: > $row=file('text.txt'); > > C. Hmm... let's start it from the beginning... hehe sorry for that, but anyways... Lets assume I want to have the row 127 in the html code of a site assigned in the variable $row_127, lets say www.example.com, then how would I have to write? Thank you. |