PHP - Foreach Loop - Adding A String To All Items Apart From The Last 4
Hi
I have an array of items that I am currently displaying a foreach loop What I'm looking to do, is add a string, to all of items, a part from the last 4: foreach ($pager->getResults() as $items => $item) { echo $item->getName(); //need to add a string to this for the all but the last 4 } Thanks Similar TutorialsBasically I have the following code (posted below) foreach($char_xml->characterInfo->characterTab->items->item as $item) { //get the item id $item_id = $item->attributes()->id; //get the xml doc for that item from wow armory $url = "http://www.wowarmory.com/item-info.xml?i=" . $item_id; $data = fetchXML($url); //create a SimpleXML object to parse the xml $item_xml = new SimpleXmlElement($data); //print the item's name echo "<li type=square>" . $item_xml->itemInfo->item->attributes()->name . " "; echo "<b>(" . $item_xml->itemInfo->item->attributes()->level . ")</b></br>"; //calculate gear score total $calc=$calc+$item_xml->itemInfo->item->attributes()->level; } echo '</ul>'; //print the total item level echo '<b>Total Additive Item Score (Equipped):</b>' . $calc; echo '<br>'; //calculate the average item level(equipped) $ilvl=$calc/16; echo '<b>Average Item Score (Equipped):</b>' . round($ilvl) . "<br><br>"; It is working relatively well for what I am trying to accomplish. It pulls xml data from wowarmory and uses it to calculate a player's "average item level". The problem I am running in to is if a player is equipped with certain items (that should not be calculated), the average is incorrect. I know atleast the shirt, tabard and off-hand need to be ignored IF equipped. I am trying to find something relative to all 3 items in the xml data and thus tell the script to disregard them. Here is a printed example of the array I am working with (warning its LONG). This is an example of a player that has these 3 extra items. Shirt (Block 4), off-hand(shield) (Block 17), and Tabard (Block19) : Quote SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=59458 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_gizmo_newgoggles [id] => 59458 [level] => 359 [name] => Energized Bio-Optic Killshades [quality] => 4 [requiredSkill] => Engineering [requiredSkillRank] => 525 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 150956 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [createdBy] => SimpleXMLElement Object ( [spell] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => trade_engineering [id] => 81720 [name] => Energized Bio-Optic Killshades ) [reagent] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 20 [icon] => inv_misc_pyriumbar [id] => 52186 [name] => Elementium Bar [quality] => 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 20 [icon] => inv_stone_15 [id] => 54849 [name] => Obsidium Bar [quality] => 1 ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 2 [icon] => inv_misc_truegold [id] => 58480 [name] => Truegold [quality] => 2 ) ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=67130 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_misc_forestnecklace [id] => 67130 [level] => 359 [name] => Dorian's Lost Necklace [quality] => 4 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 53434 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=58129 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_shoulder_mail_dungeonmail_c_04 [id] => 58129 [level] => 346 [name] => Seafoam Mantle [quality] => 3 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 112607 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_largeshard_superior [id] => 52721 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Heavenly Shard [quality] => 3 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=14617 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_shirt_red_01 [id] => 14617 [level] => 1 [name] => Sawbones Shirt [quality] => 1 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 6250 ) ) [dropCreatures] => SimpleXMLElement Object ( [creature] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Scholomance [areaUrl] => fl[source]=dungeon&fl[dungeon]=scholomance&fl[boss]=all&fl[difficulty]=all [classification] => 1 [dropRate] => 2 [heroic] => 1 [id] => 11261 [maxLevel] => 42 [minLevel] => 42 [name] => Doctor Theolen Krastinov [title] => The Butcher [type] => Humanoid [url] => fl[source]=dungeon&fl[dungeon]=scholomance&fl[difficulty]=heroic&fl[boss]=11261 ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=56563 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_chest_raidshaman_i_01 [id] => 56563 [level] => 359 [name] => Twilight Scale Chestguard [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 101750 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [createdBy] => SimpleXMLElement Object ( [spell] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => trade_leatherworking [id] => 78489 [name] => Twilight Scale Chestguard ) [reagent] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 10 [icon] => item_savageleather [id] => 52976 [name] => Savage Leather [quality] => 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_rubysanctum2 [id] => 52979 [name] => Blackened Dragonscale [quality] => 1 ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_pelt_12 [id] => 52980 [name] => Pristine Hide [quality] => 3 ) ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilewater [id] => 52326 [name] => Volatile Water [quality] => 1 ) ) [4] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilefire [id] => 52325 [name] => Volatile Fire [quality] => 1 ) ) [5] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilelife_green [id] => 52329 [name] => Volatile Life [quality] => 1 ) ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=56538 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_belt_mail_raidshaman_i_01 [id] => 56538 [level] => 359 [name] => Stormleather Sash [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 53729 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [createdBy] => SimpleXMLElement Object ( [spell] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => trade_leatherworking [id] => 78462 [name] => Stormleather Sash ) [reagent] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 10 [icon] => item_savageleather [id] => 52976 [name] => Savage Leather [quality] => 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_rubysanctum2 [id] => 52979 [name] => Blackened Dragonscale [quality] => 1 ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_pelt_12 [id] => 52980 [name] => Pristine Hide [quality] => 3 ) ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilewater [id] => 52326 [name] => Volatile Water [quality] => 1 ) ) [4] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilefire [id] => 52325 [name] => Volatile Fire [quality] => 1 ) ) [5] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_volatilelife_green [id] => 52329 [name] => Volatile Life [quality] => 1 ) ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=67148 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_pant_raidshaman_i_01 [id] => 67148 [level] => 359 [name] => Kilt of Trollish Dreams [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 196103 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=62363 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_boots_raidshaman_i_01 [id] => 62363 [level] => 359 [name] => Earthmender's Boots [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 159778 ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=59310 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_bracer_raidshaman_i_01 [id] => 59310 [level] => 359 [name] => Chaos Beast Bracers [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 102564 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [dropCreatures] => SimpleXMLElement Object ( [creature] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Blackwing Descent [classification] => 3 [dropRate] => 3 [id] => 43296 [maxLevel] => 88 [minLevel] => 88 [name] => Chimaeron [type] => Beast ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Blackwing Descent [classification] => 3 [dropRate] => 2 [id] => 47774 [maxLevel] => 88 [minLevel] => 88 [name] => Chimaeron [type] => Beast ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=60314 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_glove_raidshaman_i_01 [id] => 60314 [level] => 359 [name] => Gloves of the Raging Elements [quality] => 4 [type] => Mail ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 105223 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [dropCreatures] => SimpleXMLElement Object ( [creature] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Baradin Hold [classification] => 1 [dropRate] => 1 [id] => 47120 [maxLevel] => 88 [minLevel] => 88 [name] => Argaloth [type] => Demon ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Baradin Hold [classification] => 1 [dropRate] => 1 [heroic] => 1 [id] => 51350 [maxLevel] => 88 [minLevel] => 88 [name] => Argaloth [type] => Demon ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=59220 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_misc_rubystar [id] => 59220 [level] => 359 [name] => Security Measure Alpha [quality] => 4 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 53434 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [dropCreatures] => SimpleXMLElement Object ( [creature] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Blackwing Descent [classification] => 1 [dropRate] => 3 [id] => 42180 [maxLevel] => 88 [minLevel] => 88 [name] => Toxitron [type] => Mechanical ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Blackwing Descent [classification] => 1 [dropRate] => 3 [id] => 49050 [maxLevel] => 88 [minLevel] => 88 [name] => Toxitron [type] => Mechanical ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Blackwing Descent [classification] => 1 [dropRate] => 2 [id] => 49056 [maxLevel] => 88 [minLevel] => 88 [name] => Arcanotron [type] => Mechanical ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=67129 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_misc_pearlring1 [id] => 67129 [level] => 359 [name] => Signet of High Arcanist Savor [quality] => 4 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 53434 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=62465 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_misc_branch_01 [id] => 62465 [level] => 359 [name] => Stump of Time [quality] => 4 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 80507 ) ) [translationFor] => SimpleXMLElement Object ( [@attributes] => Array ( [factionEquiv] => 0 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_misc_branch_01 [id] => 62470 [level] => 359 [name] => Stump of Time [quality] => 4 ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=62047 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_inscription_tarot_volcanocard [id] => 62047 [level] => 359 [name] => Darkmoon Card: Volcano [quality] => 4 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 107343 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=67131 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_misc_cape_cataclysm_caster_c_01 [id] => 67131 [level] => 359 [name] => Ritssyn's Ruminous Drape [quality] => 4 [type] => Cloth ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 99205 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=61338 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_mace_1h_pvp400_c_01 [id] => 61338 [level] => 359 [name] => Vicious Gladiator's Gavel [quality] => 4 [type] => One-Handed Maces ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 334291 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=55070 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [icon] => inv_shield_bwdraid_d_02 [id] => 55070 [level] => 359 [name] => Elementium Stormshield [quality] => 4 [type] => Shields ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 115029 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) [createdBy] => SimpleXMLElement Object ( [spell] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => spell_shadow_sealofkings [id] => 76455 [name] => Elementium Stormshield ) [reagent] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 8 [icon] => inv_misc_ebonsteelbar [id] => 53039 [name] => Hardened Elementium Bar [quality] => 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [count] => 1 [icon] => inv_misc_pyriumbar [id] => 52186 [name] => Elementium Bar [quality] => 1 ) ) ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=64672 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_shield_56 [id] => 64672 [level] => 359 [name] => Relic of Norgannon [quality] => 4 [type] => Relic ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [sellPrice] => 101843 ) ) [disenchantLoot] => SimpleXMLElement Object ( [@attributes] => Array ( [requiredSkillRank] => 500 ) [item] => SimpleXMLElement Object ( [@attributes] => Array ( [canAuction] => 1 [dropRate] => 6 [icon] => inv_misc_crystalepic [id] => 52722 [level] => 85 [maxCount] => 1 [minCount] => 1 [name] => Maelstrom Crystal [quality] => 4 [type] => Enchanting ) ) ) ) ) ) SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us [requestQuery] => i=65904 [requestUrl] => /item-info.xml ) [itemInfo] => SimpleXMLElement Object ( [item] => SimpleXMLElement Object ( [@attributes] => Array ( [icon] => inv_misc_tabard_tolvir [id] => 65904 [level] => 85 [name] => Tabard of Ramkahen [quality] => 1 [type] => Miscellaneous ) [cost] => SimpleXMLElement Object ( [@attributes] => Array ( [buyPrice] => 10000 [sellPrice] => 2500 ) ) [vendors] => SimpleXMLElement Object ( [creature] => SimpleXMLElement Object ( [@attributes] => Array ( [area] => Uldum [classification] => 0 [heroic] => 1 [id] => 48617 [maxLevel] => 83 [minLevel] => 83 [name] => Blacksmith Abasi [title] => Ramkahen Quartermaster [type] => Humanoid ) ) ) ) ) ) I guess the shirt and tabard can be identified by the "[Quality]=>1" which no other items should typically have. The big issue comes with the third odd ball (off hand). This off-hand could be a shield or any weapon with few exceptions depending on the player class. As I continue to try and figure this out, one solution could be to first take the previous two "[Quality]=>1" items out of the equation IF they exist, then ONLY IF there are 17 items remaining subtract the value of block/iteration 17 before calulating as usual. If 16 items, then just run $calc is it currently is. How would I accomplish this? I do not mind displaying the item's name, in fact I would prefer to keep the item list as it currently I just need to not include the said items in the item level average. I know this is probably relatively straight forward to accomplish and that I am a noob, but would be grateful of your assistance. Thanks. Hello dear community, good day! first of all: Merry Christmas to all of you!! How to combine / concatenate a *divided* string in order to use this combined / concatenated string in a loop where i run the $dom = new DOMDocument(); @$dom->loadHTMLFile('<- path to the file-> =60119'); and the following.... numbers - Note: they replace the ending!!! 60299 64643 62958 63678 60419 60585 60749 60962 and so on. ( Question: How to combine the string (in fact the string is an URL) so that i am able to build the URLs automatically. And that i am able to run all that in a loop - eg with foreach [probably this is the right way to do that]. I hope that i was able to explain the question so that you understand it. If i have to be more descriptive - just let me know! Many many thanks for a hint! db1 Hello. I'm trying to append the loop keys and values into a string and store it into a hidden field. This is the code I have : Code: [Select] if (isset($_POST['ordered'])) { // We can assign $_POST['product'] to a variable to make it easier to type out $prod = $_POST['product']; // Throw a little intro to see how many they checked echo 'You selected ' , count($_POST['ordered']) , ' products.'; // Now we loop through it and get the IDS that were selected // Foreach lets you select the $key and the $value for each iteration of the loop // $strOrder = ""; foreach ($_POST['ordered'] as $key=>$id) { echo '<p/> ProdName: ' , $prod[$id]['name'] , '<br/> ProdPrice: ' , $prod[$id]['price'] , '<br/> ProdQty: ' , $prod[$id]['qty'] , ' <hr/>'; $strOrder .= $key . " " . $id; $TOT += $prod[$id]['price'] * $prod[$id]['qty']; } $TOT2 = $TOT + 55; echo '<input type="hidden" Name="TOT" value ="'. $TOT .'">'; echo '<input type="hidden" name="TOT2" value =". $TOT2 .'">'; echo '<input type="hidden" name="Order" value=". $strOrder . '">'; } strOrder does not get set to a value. Hello, i have the code below and i need to have all results in a variable as a string, inside the loop they are displayed how i want but outside will echo the last result. Thank You. Code: [Select] foreach($_POST as $key=>$value){ if (is_numeric($value)) { $valoare = "$value,"; } } echo $valoare; Below is my output on the browser: Student: Kevin Smith (u0867587) Course: INFO101 - Bsc Information Communication Technology Course Mark 70 Grade Year: 3 Module: CHI2550 - Modern Database Applications Module Mark: 41 Mark Percentage: 68 Grade: B Session: AAB Session Mark: 72 Session Weight Contribution 20% Session: AAE Session Mark: 67 Session Weight Contribution 40% Module: CHI2513 - Systems Strategy Module Mark: 31 Mark Percentage: 62 Grade: B Session: AAD Session Mark: 61 Session Weight Contribution 50% Now where it says course mark above it says 70. This is incorrect as it should be 65 (The average between the module marks percentage should be 65 in the example above) but for some stange reason I can get the answer 65. I have a variable called $courseMark and that does the calculation. Now if the $courseMark is echo outside the where loop, then it will equal 65 but if it is put in while loop where I want the variable to be displayed, then it adds up to 70. Why does it do this. Below is the code: Code: [Select] $sessionMark = 0; $sessionWeight = 0; $courseMark = 0; $output = ""; $studentId = false; $courseId = false; $moduleId = false; while ($row = mysql_fetch_array($result)) { $sessionMark += round($row['Mark'] / 100 * $row['SessionWeight']); $sessionWeight += ($row['SessionWeight']); $courseMark = ($sessionMark / $sessionWeight * 100); if($studentId != $row['StudentUsername']) { //Student has changed $studentId = $row['StudentUsername']; $output .= "<p><strong>Student:</strong> {$row['StudentForename']} {$row['StudentSurname']} ({$row['StudentUsername']})\n"; } if($courseId != $row['CourseId']) { //Course has changed $courseId = $row['CourseId']; $output .= "<br><strong>Course:</strong> {$row['CourseId']} - {$row['CourseName']} <strong>Course Mark</strong>" round($courseMark) "<strong>Grade</strong> <br><strong>Year:</strong> {$row['Year']}</p>\n"; } if($moduleId != $row['ModuleId']) { //Module has changed if(isset($sessionsAry)) //Don't run function for first record { //Get output for last module and sessions $output .= outputModule($moduleId, $moduleName, $sessionsAry); } //Reset sessions data array and Set values for new module $sessionsAry = array(); $moduleId = $row['ModuleId']; $moduleName = $row['ModuleName']; } //Add session data to array for current module $sessionsAry[] = array('SessionId'=>$row['SessionId'], 'Mark'=>$row['Mark'], 'SessionWeight'=>$row['SessionWeight']); } //Get output for last module $output .= outputModule($moduleId, $moduleName, $sessionsAry); //Display the output echo $output; I think the problem is that it is outputting the answer of the calculation only for the first session mark. How in the while loop can I do it so it doesn't display it for the first mark only but for all the session marks so that it ends up showing the correct answer 65 and not 72? I have an array of products. The array has an ID and price. I'd like to know the most efficient way of adding up all the same ID fields in the array. Code: [Select] <?php $items[] = array( 'id' => 1, 'price' => 5.99, ); $items[] = array( 'id' => 2, 'price' => 1.99, ); $items[] = array( 'id' => 3, 'price' => 2.40, ); $items[] = array( 'id' => 2, 'price' => 6.99, ); $items[] = array( 'id' => 4, 'price' => 8, ); $items[] = array( 'id' => 2, 'price' => 3, ); $items[] = array( 'id' => 3, 'price' => 1, ); function add_like_items($items) { //manipulation return $sums; } //$sums would be an array like //$sum[1] = 5.99 //$sum[2] = 11.98 //$sum[3] = 3.40 //$sum[4] = 8 ?> Anybody have suggestions on the best way to go about doing this? Hi, Im trying to learn how to build a shopping cart system, im have a few problems and im not sure where im going wrong, it looks as though im getting an item into the session, but it looks like when i add another it over writing the first one, and im having trouble trying to echo it out. Here is what i have atm Code: [Select] session_start(); include('functions.php'); $pid = $_GET['product']; $q = $_GET['qty']; if($_GET['function']=="add") { echo "add " . $_GET['product']; $_SESSION['cart']=array(); $_SESSION['cart']['productid']=$pid; $_SESSION['cart']['qty']=$q; } print_r($_SESSION['cart']); echo showCart(); Am i way off on my code? regardless of how many things i try to add to session, all i can print out is the last one i entered. Cheers hello all, I was hoping someone could help me figure out how to add sizes to my shopping cart. Right now the items add just fine. The site sells shirts and I'm having trouble displaying the sizes once selected and added to the cart. It will post the size selected, but if the customer tries to add another shirt the size will overwrite the last. Any help is appreciated. Heres how I add items to the cart... Code: [Select] session_start(); // Process actions $cart = $_SESSION['cart']; $action = $_GET['action']; switch ($action) { case 'empty': if($cart) { unset($cart); } break; case 'add': if ($cart) { $cart .= ','.$_GET['product_id']; } else { $cart = $_GET['product_id']; } break; The form with the size selection and add to cart button.. Code: [Select] <form action="cart.php?action=add&product_id=<?php echo $row_rs_products['product_id'] ?>" method="POST" name="addcart" id="addcart"> <table width="300" border="0"> <tr> <td><label for="sizes"></label> <select name="product_size" id="product_size" title="<?php echo $row_rs_products['product_size']; ?>"> <?php do { ?> <?php } while ($row_rs_sizes = mysql_fetch_assoc($rs_sizes)); $rows = mysql_num_rows($rs_sizes); if($rows > 0) { mysql_data_seek($rs_sizes, 0); $row_rs_sizes = mysql_fetch_assoc($rs_sizes); } ?> </select></td> <td><input type="submit" name="submit" id="submit" value="add to cart"> function displaying the cart.. Code: [Select] function showCart() { global $db; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $output[] = '<form action="cart.php?action=update" method="post" id="cart">'; $output[] = '<table>'; // start div $output[] = '<div id="cart_table">'; // $output[] = '<tr>'; $output[] = '<td><h4>Product</h4></td>'; $output[] = '<td><h4>Item No.</h4></td>'; $output[] = '<td><h4>Price</h4></td>'; $output[] = '<td><h4>Size</h4></td>'; $output[] = '<td><h4>Quantity</h4></td>'; $output[] = '<td><h4>Price Total</h4></td>'; $output[] = '<td><h4> </h4></td>'; $output[] = '</tr>'; //new row foreach ($contents as $product_id=>$qty) { $sql = 'SELECT * FROM products WHERE product_id = '.$product_id; $result = $db->query($sql); $row = $result->fetch(); extract($row); // $output[] = '<tr>'; $output[] = '<td><a href="product.php?product_id='.$product_id.'">'.$product_title.'</a></td>'; $output[] = '<td>'.$product_plu.'</td>'; $output[] = '<td>$'.$product_price.'</td>'; // //$output[] = '<td>'.$product_size.'</td>'; $output[] = '<td>'.$_POST['product_size'].'</td>'; // $output[] = '<td><input type="text" name="qty'.$product_id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; $output[] = '<td>X $'.($product_price * $qty).'</td>'; $total += $product_price * $qty; $output[] = '<td><a href="cart.php?action=delete&product_id='.$product_id.'" class="r">Remove</a> </td>'; $output[] = '</tr>'; //end div $output[] = '</div>'; } $output[] = '</table>'; $output[] = '<p>Grand total: <strong>$'.$total.'</strong></p>'; $output[] = '<div class="float-right"><button type="submit">Update cart</button>'; $output[] = '</form>'; Hey guys, Got another question im hoping someone can help me with. I have a foreach loop (for use in a mysql query): foreach ($interests as $interest) { $query .= "($id, $interest), "; } problem is i do not want the comma(,) in the last loop. Is there some kinda of function i can use so it does not insert it on last loop? Or should i just use a for loop with a nested if loop? something like ; for($i=0; $i < count($interests); $i++){ $query .= "($id, '$interests[$i]')"; if($i + 1 < count($interests)) { $query .= ", "; } } Cheers guys I am stuck on inserting the data into mysql via php. Its a foreach method and I am just stuck Code: [Select] include '../Database/take_an_exam.php'; $intNum = 1; $intnumber = 1; while( $info = mysql_fetch_array( $sqll )){ echo "<input type='hidden' name=\"Que_ID\" value=\"{$info['Que_ID']}\" /> "; echo " $intNum, {$info['Que_Question']} <br />\n"; $intNum++; for ($i =1; $i < 5; $i++) { echo "<input type=\"checkbox\" name=\"choice[{$info['Que_ID']}.$i][]\" />{$info['Que_Choice'.$i]}<br />\n"; $intnumber++; } } ?> <input type="submit" value="submit" name="submit"> This is my form that can output the Question and its choices. I am echoing this on to the next page, the code is shown below Code: [Select] <?PHP session_start(); $name= $_SESSION['username1']; echo "User ID: $name <br/>"; $gender = $_POST["choice"]; $que_ID = $_POST["Que_ID"]; foreach ($gender as $key => $array) { if($array) { $val=1; } ///echo "Question ID and the choice ID:$key. Value is:.$val <br />\n"; $well = array(floor($key), substr(strstr($key, '.'), 1)); //$well = array(floor($key), $key - floor($key)); echo "Question ID: $well[0], "; echo "Choice: $well[1]. value: $val<br/>"; } //}break; ?> Now, instead of echoing. I just want to add this to mysql. The layout of my sql is Que_ID, Ans_Choice1, Ans_Choice2, Ans_Choice3, Ans_Choice4, Use_ID When I echo my php my outcome is Quote User ID: 2 Question ID= 1 Choice 1 Question ID= 2 Choice 3 Question ID= 3 Choice 4 Question ID= 4 Choice 1 Hi all, I have a long script that processes only one image at the moment. What I am trying to do is put all the script in to a 'foreach' section so that I can process more than just one image. Could someone show me how to do this, putting all the uploaded images in to an array (i guess is the best option) and tell me what the form input names need to be below. The script I was trying to make in principle was: <?php $reg = "G-BAAA"; $count-number-of-files-being-uploaded = x ; // NUMBER OF FILES?? $number = 0; foreach $_FILES { // THIS IS WHERE THE IMAGES ARE UPLOADED AND THUMBNAILS CREATED. THE NAMES OF THE FILES ARE $reg.$number."."$ext; $number++; } ?> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td><input type="file" name="image[]" ></td></tr> <tr><td><input type="file" name="image[]" ></td></tr> <tr><td><input name="Submit" type="submit" value="Upload image"></td></tr> </table> </form> Hi all, I have a table that shows data from an xml response that has been converted to an array. I have successfully managed to get that to work but it's showing more items than I want. I'm trying to isolate the items by state. There are 11 or so different states, of which I only want 7. I've tried the following with a while loop but I keep getting the message "undefined index: job_status" Here's my code (partial) $projects = array(); $xml=simplexml_load_string($response) or die("Error: Cannot create object"); foreach($xml->Jobs->Job as $item) { $projects[] = array( 'job_no' => (string)$item->ID, 'job_name' => (string)$item->Name, 'job_due' => (string)$item->DueDate, 'job_status' => (string)$item->State, 'job_staff' => (string)$item->Assigned->Staff->Name, ); } usort($projects, function($a,$b) {return $a['job_due'] <=> $b['job_due']; } ); $projects = array_reverse($projects); while ($projects['job_status'] == ('Feasibility') && ('Measure Up') && ('Model Drawing') && ('Concept Design') && ('Developed Design') && ('Resource Consent') && ('Construction Documentation')) { foreach ($projects as $proj) { $formatted = date('d/m/Y', strtotime($proj['job_due'])); $job_no ="{$proj['job_no']}"; $job_name ="{$proj['job_name']}"; $job_due ="$formatted"; $job_status ="{$proj['job_status']}"; $job_staff ="{$proj['job_staff']}"; Any help would be much appreciated thanks. what im trying to do is echo all of the results from the database query but add bold to results with a pid of 0. here is my code: $list = ''; $query = $link->query("SELECT * FROM ".TBL_PREFIX."forums ORDER BY f_lid ASC"); $result = $query->fetchAll(); foreach($result as $key => $val) { if($result[$key]['f_pid'] == 0) { $list .= '<b>'.$result[$key]['f_name'].'</b><br />'; } $list .= $result[$key]['f_name'].'<br />'; } echo $list; this works fine but the ones with a pid of 0 are displayed twice. once as bold and then once normal like so: General General New Features Testing Testing Sandbox Bugs my question is how to prevent this. Hey guys, need help on some addition. foreach($login as $line_num => $line) { $login = explode(" ", htmlspecialchars(str_replace(" "," ",$line))); if(stristr($login[1], "\n")) $login[1] = substr($login[1], 0, strlen($login[1])-2); $account_data[$line_num] = array($login[0], $login[1]); $UserID = $login[0]; $AuthKey = $login[1]; $MobLink = "http://mobsters-fb-apache-dynamic-lb.playdom.com/mob_fb/"; $RefreshStat = file_get_contents($MobLink."refresh_stat_manual?user_id=".$UserID."&auth_key=".$AuthKey); $Cash = explode ("<cash>", $RefreshStat); $Cash = explode ("<", $Cash[1]); $Cash = $Cash[0]; $CashForEcho = "$".number_format($Cash[0]); echo $CashForEcho."<br/>"; echo "<br/><br/>"; } The variable $Cash will be dynamic for each user I put in the $login_file, and I need to add all of those values up. So say I put in 3 users within the $login_file, and the $Cash for user 1 was $3,000, the $cash for user 2 was $6,000 and the $cash for user 3 was $1,000, I want to be able to automatically add them all up, so it would echo '$10,000' at the end. Hope I've explained it for you guys to understand easily enough, if not let me know. Thanks how do I echo "blah" after the first loop in a foreach loop and the in the rest of them echo "crazy"? I have a foreach loop which shows the breadcrumb display. But it's stopped working. For some reason the links are no longer links. They are just echoed on screen with no <a> tags. setting up array: $crumb_query = mysqli_query($link, "SELECT f.forum_id, f.forum_cat_id, f.forum_name, c.cat_id, c.cat_name FROM ".TBL_PREFIX."forums as f LEFT JOIN ".TBL_PREFIX."categories as c ON c.cat_id = f.forum_cat_id WHERE f.forum_id = '$forum_id' ") or die(mysqli_error($link)); $crumb_info = mysqli_fetch_array($crumb_query, MYSQLI_ASSOC); $crumbs = array("index.php" => "Board Index", "./view_category.php?cid={$crumb_info['cat_id']}" => $crumb_info['cat_name'], "./view_topics.php?fid=$forum_id" => $crumb_info['forum_name']); echo build_crumbs($crumbs); the function: function build_crumbs($crumbs) { foreach($crumbs as $key => $value) { $crumb_display = "<a href=\"{$key}\">{$value}</a>"; $crumb_display = implode(" - ", $crumbs); } return $crumb_display; } can anyone see where im going wrong? For some reason I'm getting an invalid argument supplied for foreach error and I'm not sure why. Code: [Select] <?php // Include the database page require ('../inc/dbconfig.php'); if (isset($_POST['edit_event_lineup'])) { $event_items = $_POST['event_items']; $event_id = (int)$_POST['event_id']; foreach ($event_items as $items) { print_r($items); $segment_writer_id = (int)$_POST['segment_writer_id']; $introduction = mysqli_real_escape_string($dbc, $_POST['introduction']); $conclusion = mysqli_real_escape_string($dbc, $_POST['conclusion']); $segment_type = mysqli_real_escape_string($dbc, $_POST['segment_type']); $match_number = (int)$_POST['match_number']; $segment_number = (int)$_POST['segment_number']; $match_type_id = (int)$_POST['match_type_id']; $segment_title = mysqli_real_escape_string($dbc, $_POST['segment_title']); $match_type_id = mysqli_real_escape_string($dbc, $_POST['match_type_id']); $titles_id_list = mysqli_real_escape_string($dbc, $_POST['titles_id_list']); $stipulations_id_list = mysqli_real_escape_string($dbc, $_POST['stipulations_id_list']); $characters_id_list = mysqli_real_escape_string($dbc, $_POST['character_id_list']); $preview = mysqli_real_escape_string($dbc, $_POST['preview']); } $query = "INSERT INTO `event_segments` (event_id, segment_writer_id, segment_type, sort_order_preview, segment_title, preview, is_submitted_yes_or_no_id) VALUES ('".$event_id."', '".$match_writer_id."', '".$segment_type."' ,'".$sort_order_preview."','".$segment_title."','".$preview."',2)"; mysqli_query($dbc, $query); } ?> I am working on a photo gallery script in which I need to show 9 images at a time. Here is my script so far Code: [Select] <?php foreach($pictures->result() as $p): ?> <?php for($i = 1; $i <= 9; $i++) { ?> <div class="item"> <ul> <li><a href="images/gallery/<?=$p->category;?>/<?=$p->photo_name;?>" rel="example1" ><img src="images/gallery/<?=$p->category;?>/thumb_<?=$p->photo_name;?>" alt="#" /></a></li> </ul> </div><!-- end item --> <?php } ?> <?php endforeach; ?> At the moment the script is showing one image at a time 9 times and for every entry in my database. I have been battling this for a little while now. Thanks in advance for all of your help! Does anybody know how to make the following code correct? real sorry but its just absolutely blowing my mind im awful with loops and have pretty much no clue what the hell im doing in honesty, any help would be great, Thanks Code: [Select] $addIDs_ary = array_map('intval', $_POST['chkInv']); $addIDs_ary = array_filter($addIDs_ary); $value = $addIDs_ary; //Check if hit_id is already in hitlist $query = mysql_query("SELECT * FROM hitlist WHERE player_id = '$playerID'"); $result = mysql_query($query); while ($result = mysql_fetch_assoc($result)) foreach ($result as $hit_id => $value){ if($result[$hit_id] == $value); $str = ""; } } else Hey Guys. I have a custom function that simply loops through an array and outputs the menu categories it finds in the array.
The foreach loop passes the function an array and the function returns the the value. The problem is that the function returns that last value.
Now I know some of you might say ... "Why don't you put the foreach inside the function and return the value when the foreach loop has been completed"
The reason why is because I to use that foreach loop through another function as well. I was thinking about using globals to get the return value. But just wanted to get your perspective on the best option here.
Please let me know what you guys think Thanks
User Defined Function
function displayMenuCategories($menu_category){ $display_menu =""; $category_id = $menu_category['menu_cat_id']; $display_menu .= "<div class='menu_cat'>{$menu_category['menu_cat_name']}</div><br>\n"; if(!empty($menu_category['menu_cat_desc'])) { $display_menu .= "<div class='menu_desc'>{$menu_category['menu_cat_desc']}</div>\n"; } $category_info = array("display" => $display_menu, "category_id" => $category_id ); return $category_info; }Foreach loop $left_menu_categories // Is the array that contains all the menu categories foreach($left_menu_categories as $left_menu_category){ $get_categories = displayMenuCategories($left_menu_category); } var_dump($get_categories); Edited by eldan88, 06 July 2014 - 05:01 PM. |