You are here: Re: Help with array « PHP Programming Language « IT news, forums, messages
Re: Help with array

Posted by Jim Carlock on 03/12/07 01:57

"aarondeloach" posted...
<snip>
[018821] => Automotive Parts
[222033] => Automotive Parts\Domestic
[205884] => Automotive Parts\Foreign
[987219] => Building Supplies
[624668] => Building Supplies\Lumber
[063964] => Building Supplies\Lumber\Hardwood
[592999] => Building Supplies\Lumber\Hardwood\Steel
[987808] => Building Supplies\Lumber\Structural
[169626] => Building Supplies\Lumber\Treated
[966554] => Building Supplies\Plumbing
[329645] => Construction Adhesives
[621126] => Roofing Supplies
[400762] => Roofing Supplies\Asphalt Roofing
[475138] => Roofing Supplies\Metal Roofing
</snip>

// constants are optional... recommended, and an editor such
// as SciTE recommended when messing with such things.
// SciTE is easily configurable to handle ALL your constants
// and functions and can easily provide Intellisense to help
// with your software development.
define("AUTOMOTIVE", 0);
define("BUILDING", 1);
define("ADHESIVES", 2);
define("ROOFING", 3);
define("LUMBER", 4);
define("HARDWOOD", 5);
define("HARDWOOD_STEEL", 6);
define("STRUCTURAL", 7);
define("TREATED", 8);
define("PLUMBING", 9);
define("ROOFING", 10);
define("ROOFING_ASPHALT", 11);
define("ROOFING_METAL", 12);

// constants for fields
define("INV_INDEX", 0);
define("INV_CATEGORY", 1);
define("INV_PARENT", 2);
define("INV_ID", 3);

// index, category_name, parent_category, id_number
$aCategories = array(
array(0, "Inventory", 0, 0),
array(1, "Automotive Parts", 0, 018821),
array(2, "Foreign", 1, 205884),
array(3, "Domestic", 1, 222033),
array(4, "Building Supplies", 0, 987219),
array(5, "Construction Adhesives", 0, 329645),
array(6, "Roofing Supplies", 0, 621126),
array(7, "Lumber", 4, 400762),
array(8, "Hardwood", 7, 063964),
array(9, "Steel", 8, 592999),
array(10, "Structural", 7, 987808),
array(11, "Treated", 7, 169626),
array(12, "Plumbing", 4, 966554),
array(13, "Asphalt Roofing", 6, 400762),
array(14, "Metal Roofing", 6, 475138)
);

Those represent some possible suggestions.

Other than that, there's always the split() function if you need
regular expression abilities, or the explode() function for quick
and easy tearing up strings with slashes...

http://us2.php.net/manual/en/function.explode.php
http://us2.php.net/manual/en/function.split.php

Hope this helps.

--
Jim Carlock
Post replies to the group.

 

Navigation:

[Reply to this 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

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