Reply to Re: [PHP] Breaking up data efficiently

Your name:

Reply:


Posted by Kevin L'Huillier on 06/28/05 07:53

I agree, your implementation is efficient. It does depend on the data
being entirely proper, however. If you can not be entirely sure (and
you should rarely be), i might add a suggestion that increases code
length, but decreases the chance of problems:

You might consider creating a function to validate the location as
well as list() = explode() it.

$locations = explode('|', $booking->booking_flight_details);

foreach ($locations as $location)
$list[] = split_location($location);

Create the function split_location to return the associative array or,
if it is invalid, throws an exception. If PHP4, replace the exception
with similar error handling.

[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

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