Page 1 of 1

Parsing information from an excel sheet

Posted: Tue Oct 05, 2010 2:58 am
by kaybaybayy
Alright so I am trying to parse through an excel file using php. In the column that I am first looking at it has the names of various organizations (like "Atlas" "Foto" "Ohana") from the excel sheet and then comparing it with the organization names in an online database. The issue that I am having is that after getting the data from the excel sheet I cannot compare it with the database information. I have tried using strcmp($excel_name, $database_name) as well as if ($excel_name == $database_name) but it always returns -1 or false depending on the situation.

I have tried my best to make sure that both values are strings and I have used trim but I feel like I might be getting the value from the excel sheet incorrectly. When I echo out the values for the $excel_name and $database_name they are the same so I really can't peg the problem.

If anyone has experienced something like this I would love some advice. I've done this sort of thing with python before but I can't seem to get this part. Womp. But either way, thanks!

Re: Parsing information from an excel sheet

Posted: Tue Oct 05, 2010 11:59 am
by John Cartwright
Try using the case insensitive version, strcasecmp().

Also, try a var_dump() on both variables and post an example of whats not comparing equally.