[thelist] CSV+PHP, MORE
Mark Joslyn
Mark.Joslyn at SolimarSystems.com
Mon Aug 19 11:47:00 CDT 2002
Thanks JAY!
Was trying to stay PHP3 though - the ISP I am building this to run on only
accepts PHP3 scripts (have this running with PHP4 + mySQL already (not
supported though)). Will try the first suggestion!
Thanks,
markJ
-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Jay Blanchard
Sent: Monday, August 19, 2002 9:34 AM
To: thelist at lists.evolt.org
Subject: RE: [thelist] CSV+PHP, MORE
[snip]
I can get the CSV file to read in (fgetcsv) and print it's entire contents
into a table, however, I want it only to print out the record that matches a
variable set in a preceeding form.
So, when a custmer enters model # ABC, I want PHP to run through the
contents of the CSV file (300 records) and search for the row that contains
model # ABC. If found, only that row will print.
[/snip]
http://www.php.net/manual/en/function.in-array.php
Just ran across this when consulting the manual for something else. From the
PHP manual page;
in_array
(PHP 4 )
in_array -- Return TRUE if a value exists in an array
Description
bool in_array ( mixed needle, array haystack [, bool strict])
Searches haystack for needle and returns TRUE if it is found in the array,
FALSE otherwise.
If the third parameter strict is set to TRUE then the in_array() function
will also check the types of the needle in the haystack.
Note: If needle is a string, the comparison is done in a case-sensitive
manner.
Note: In PHP versions before 4.2.0 needle was not allowed to be an array.
HTH!
Jay
I do whatever my rice crispies tell me to
***********************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* San Antonio Area PHP Developers Group *
* Interested? Contact jay.blanchard at niicommunications.com *
***********************************************************
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list