Re: Need some help folks....

From: Date: Tue, 28 Nov 2000 20:22:09 +0000
Subject: Re: Need some help folks....
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-27673@lists.php.net to get a copy of this message
Ok modify it like this: $foo = explode('_',$key); $section = $foo[0]; then when the section changes then restart a section. --Joe On Wed, Nov 29, 2000 at 02:33:27AM -0800, Dallas Kropka wrote: > Thanks for the quick response Joe, but there is a problem with this.... each > key is different in regards to the latter half of the key.... here is the > whole array..... > > $cat_arr= array( "online" =>"Online Business ", > "rent_auto" =>"Automobile / Boat Rentals > ", > "rent_construction" =>"Construction Equipment > ", > "rent_costumes" =>"Costumes / Party Equipment > ", > "rent_sound_vid" =>"Sound / Video Equipment > ", > "rent_sports" =>"Sports Equipment ", > "rent_videos" =>"Video Rentals ", > "retail_antique" =>"Antique ", > "retail_appliance" =>"Appliance ", > "retail_auto" =>"Automotive Dealers ", > "retail_books" =>"Books ", > "retail_bridal" =>"Bridal ", > "retail_clothes" =>"Clothing / Accessories > ", > "retail_computer" =>"Computer, Software &amp; > Hardware ", > "retail_consignment" =>"Consignment Stores > ", > "retail_cosmetics" =>"Cosmetics, Skin Care > ", > "retail_laundry" =>"Dry Cleaners &amp; > Laundries > ", > "retail_florist" =>"Florist ", > "retail_furniture" =>"Furniture, Home > Furnishings ", > "retail_general" =>"General Merchandise > ", > "retail_gifts" =>"Greeting Cards / Gifts > ", > "retail_health" =>"Health &amp; Fitness > ", > "retail_industrial" =>"Industrial Equipment > ", > "retail_jewels" =>"Jewelers ", > "retail_lawn" =>"Lawn &amp; Garden > ", > "retail_liquor" =>"Liquor ", > "retail_medical" =>"Medical ", > "retail_music" =>"Music - Store &amp; > Recording > Studios ", > "retail_pawn" =>"Pawn Shops ", > "retail_pawn" =>"Pets, Pet Care ", > "retail_photo" =>"Photo / Video / Multi-media > ", > "retail_salon" =>"Salon ", > "retail_sports" =>"Sporting Goods ", > "retail_home_apps" =>"TV, Home Appliance > ", > "retail_upholstery" =>"Upholstery ", > "retail_vending" =>"Vending Machines ", > "food_bakery" =>"Bakeries ", > "food_bar" =>"Bars, Night Clubs ", > "food_convince" =>"Convince Store ", > "food_restaurant" =>"Restaurants ", > "food_deli" =>"Specialty, Deli ", > "food_supermarket" =>"Supermarket ", > "serv_apartment" =>"Apartment Locators ", > "serv_living" =>"Assisted Living ", > "serv_camping" =>"Campground, Mobile Home Parks > ", > "serv_carpet" =>"Carpet/Floor Cleaning ", > "serv_catering" =>"Catering/Delivery ", > "serv_child_care" =>"Child Care ", > "serv_cleaning" =>"Cleaning, Refurbishing > ", > "serv_training" =>"Education, Training Services > ", > "serv_employment" =>"Employment/Staffing > ", > "serv_furniture" =>"Furniture Refinishing > ", > "serv_glass" =>"Glass, Glass Repair &amp; > Replacement ", > "serv_home_repair" =>"Home Repair ", > "serv_hotels" =>"Hotels, Inns, Motels, > B&amp;B > ", > "serv_janitor" =>"Janitorial, Maintenance > ", > "serv_landscape" =>"Landscaping ", > "serv_legal" =>"Legal Services ", > "serv_mechanic" =>"Mechanic / Mechanical Repairs > ", > "serv_medical" =>"Medical, Dental ", > "serv_moving" =>"Moving &amp; Storage > ", > "serv_rec" =>"Recreation ", > "serv_securtiy" =>"Security ", > "serv_social" =>"Social Services ", > "serv_travel" =>"Travel ", > "man_apparel" =>"Apparel ", > "man_boat" =>"Boat/Marine ", > "man_wood" =>"Cabinetry, Woodwork ", > "man_chem" =>"Chemicals ", > "man_construction" =>"Construction ", > "man_electrical" =>"Electrical, Electronics > ", > "man_fab_metal" =>"Fabricated Metal Prod > ", > "man_food" =>"Food ", > "man_general" =>"General, Specialty ", > "man_industrial" =>"Industrial, Commercial > Machinery ", > "man_housing" =>"Manufactured Housing ", > "man_monuments" =>"Monuments ", > "man_plastics" =>"Plastics ", > "man_recreation" =>"Recreation ", > "man_tile" =>"Tile ", > "man_timber" =>"Timber, Lumber ", > "man_auto" =>"Transportation Equipment ", > "fin_accounting" =>"Accounting ", > "fin_advertising" =>"Advertising ", > "fin_banking" =>"Banking ", > "fin_insurance" =>"Insurance ", > "fin_credit" =>"Mortgage, Credit ", > "fin_estate" =>"Real Estate ", > "fin_sales" =>"Sales/Marketing ", > "trans_ambulance" =>"Ambulance ", > "trans_general" =>"General ", > "trans_taxi" =>"Taxi ", > "other_agg" =>"Agriculture ", > "other_art" =>"Art Galleries ", > "other_crafts" =>"Arts, Crafts &amp; Hobby > Shops > ", > "other_aviation" =>"Aviation ", > "other_boat" =>"Boating, Marinas ", > "other_building" =>"Building Materials ", > "other_caskets" =>"Caskets ", > "other_dance" =>"Dance Studio ", > "other_heating" =>"Heating &amp; Air > Conditioning (HVAC) ", > "other_machine" =>"Machine Shops ", > "other_mail" =>"Mail Box and Personal Services > ", > "other_oil" =>"Oil Field, Drilling ", > "other_plumbing" =>"Plumbing ", > "other_printing" =>"Printing ", > "other_publishing" =>"Publishing ", > "other_racing" =>"Racing ", > "other_recycling" =>"Recycling ", > "other_talent" =>"Talent/Modeling ", > "other_tanning" =>"Tanning Salons ", > "other_telecom" =>"Telecommunications ", > "other_travel" =>"Travel Agencies ", > "other_util" =>"Utilities ", > "other_vending" =>"Vending Machines ", > "other_wholesale" =>"Wholesale Distributors > ", > ); > > > > > What I need to do is sort for each catagory, and when I encounter a key > where the FIRST part of the key (retail_*, serv_*,....) is differant, then I > need to break my listing and enter a new heading in the list.... > > http://64.78.177.204/sell-a-biz/new_code/category.php3 > > this is what I have now.... but you cant navigate it... I can take care of > everything but matching that key.... any thoughts? > > > > > > > > > > > > > > > ----- Original Message ----- > From: "Joe Stump" <joe@earth.care2.com> > To: "Dallas Kropka" <dallask@firstworld.net> > Cc: <php-general@lists.php.net> > Sent: Tuesday, November 28, 2000 12:14 PM > Subject: Re: [PHP] Need some help folks.... > > > > Put the key in a dumping ground like $working_key and then when you come > to > > one that != $working_key start a new category. This will ONLY work if the > > array is sorted / grouped by key. > > > > --Joe > > > > On Wed, Nov 29, 2000 at 02:25:00AM -0800, Dallas Kropka wrote: > > > I have an array of categories that I need to turn into text links.... > the array looks like this but contains many more listings.... > > > > > > "online" =>"Online Business > > > "rent_auto" =>"Automobile / Boat Rentals > > > "retail_antique" =>"Antique > > > "food_bakery" =>"Bakeries > > > "serv_apartment" =>"Apartment Locators > > > "man_apparel" =>"Apparel > > > "fin_accounting" =>"Accounting > > > "other_agg" =>"Agriculture > > > > > > > > > you get the idea.... What I need to do is check the KEY of the array, > and when the key changes, I need to start a new section in the links like > so... > > > > > > Online Businesses..... > > > ......... > > > ........ > > > > > > Rentals > > > ......... > > > ......... > > > > > > Retail > > > > > > Etc.... > > > > > > > > > How do you suppose I should do this? The trick to the KEY is to check > the first part of the KEY and if it changes, then to change the section.... > but how? > > > > > > Much thanks... > > > Dallas K. > > > ============================================================================ > ==== > > = Joe Stump joestump98@yahoo.com > http://www.miester.org = > > > ============================================================================ > ==== > > Need a programmer? > > http://www.google.com/search?q=joe+stump+resume > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ Need a programmer? http://www.google.com/search?q=joe+stump+resume

« previous php.general (#27673) next »