• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

File parsing with PHP

rapmaster

New Member
ok lets say I have main file that looks like this:

04 Jimmy Jones
02 Tom Isban
21 Richardo Playzalot


now I need to searh through this file by:

$id $firstname $lastname


How do I parse the file in PHP? I know how to in CGI but no in PHP and havn't been able to find any help files on how to do it. Please help.
 
Read the file by string..
And use 'explore' command

Code:
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode (" ", $pizza);

You may use 'split' if you want.. but the document says that 'explode' is faster.

Please try to consult the document before asking the question.

The document can be downloaded from here
http://www.php.net/download-docs.php
 
Back
Top