Skip to main content

🛍️ BLACK FRIDAY get-one-give-one sale is underway. Don't miss $50 off PLUS a free subscription to gift a friend. 🤩

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Alex Forseth
    Alex Forseth
    8,017 Points

    strtolower($item["category"])?

    Posted April 19, 2018 11:00pm by Alex Forseth
    Alex Forseth
    8,017 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Anthony Beckles
    Anthony Beckles
    2,057 Points

    Not sure why I am getting this. Can anyone see something I can't?

    Posted March 18, 2018 3:12pm by Anthony Beckles
    Anthony Beckles
    2,057 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    4 Answers

  • Alex Forseth
    Alex Forseth
    8,017 Points

    At which point in the array_category function was the parameter $category defined?

    Posted February 6, 2018 5:54am by Alex Forseth
    Alex Forseth
    8,017 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Oleksii Temchenko
    Oleksii Temchenko
    3,474 Points

    Why do we need $id as the first argument in echo get_item_html($id, $catalog[$id])?

    Posted January 30, 2018 3:45pm by Oleksii Temchenko
    Oleksii Temchenko
    3,474 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    0 Answers

  • Colin Sharkey
    Colin Sharkey
    14,631 Points

    Images not displaying

    Posted October 23, 2017 11:41pm by Colin Sharkey
    Colin Sharkey
    14,631 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    0 Answers

  • Fabian Pijpers
    PLUS
    Fabian Pijpers
    Courses Plus Student 41,372 Points

    Pictures displaying left and size varies!

    Posted September 17, 2017 3:40pm by Fabian Pijpers
    Fabian Pijpers
    Courses Plus Student 41,372 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Pawandeep ShopWired
    PLUS
    Pawandeep ShopWired
    Courses Plus Student 9,848 Points

    Parse error: syntax error, unexpected end of file in /home/treehouse/workspace/index.php on line 27

    Posted August 10, 2017 2:32pm by Pawandeep ShopWired
    Pawandeep ShopWired
    Courses Plus Student 9,848 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    3 Answers

  • Juras Rabačauskas
    Juras Rabačauskas
    7,425 Points

    Foreach as $id => $item

    Posted April 27, 2017 10:44am by Juras Rabačauskas
    Juras Rabačauskas
    7,425 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    0 Answers

  • Sarfaraj Alam
    Sarfaraj Alam
    14,074 Points

    Warning: Illegal string offset 'category' in /home/treehouse/workspace/inc/function.php on line 16

    Posted April 16, 2017 5:41am by Sarfaraj Alam
    Sarfaraj Alam
    14,074 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Amber O'Rear
    Amber O'Rear
    7,791 Points

    Working on displaying specific categories for each page and all the sudden I am getting this error when refreshing

    Posted March 27, 2017 8:00pm by Amber O'Rear
    Amber O'Rear
    7,791 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Jackson Hyland
    Jackson Hyland
    4,920 Points

    Displaying Categories - my pages won't display any content after following the video and checking against her code.

    Posted February 7, 2017 12:26am by Jackson Hyland
    Jackson Hyland
    4,920 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • ammarkhan
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points

    Why is function so hard to understand

    Posted July 2, 2016 1:55am by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • hakan Gülay
    hakan Gülay
    8,489 Points

    Couldn't understand

    Posted June 27, 2016 10:28am by hakan Gülay
    hakan Gülay
    8,489 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • John O mahoney
    John O mahoney
    578 Points

    Unclear on what this line is doing $output[$id] = $sort;

    Posted June 14, 2016 2:42pm by John O mahoney
    John O mahoney
    578 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • John O mahoney
    John O mahoney
    578 Points

    I dont understand this part of the foreach

    Posted June 13, 2016 2:07pm by John O mahoney
    John O mahoney
    578 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • john larson
    john larson
    16,594 Points

    I'm lost...again 0o)

    Posted June 11, 2016 1:38am by john larson
    john larson
    16,594 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    0 Answers

  • john larson
    john larson
    16,594 Points

    Notice: Undefined index: catagory in /home/treehouse/workspace/inc/functions.php on line 17

    Posted June 8, 2016 1:13am by john larson
    john larson
    16,594 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Flo Tubes
    Flo Tubes
    5,110 Points

    errormessage:Warning: Invalid argument supplied for foreach() in /home/treehouse/workspace/catalog.php on line 38

    Posted May 8, 2016 6:21pm by Flo Tubes
    Flo Tubes
    5,110 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Robert Tufts
    Robert Tufts
    1,416 Points

    I'm getting the "Warning: Illegal string offset 'category' in home/treehouse/workspace/inc/functions.php on line 19" err

    Posted April 27, 2016 10:06pm by Robert Tufts
    Robert Tufts
    1,416 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Javier MARQUEZ
    Javier MARQUEZ
    11,877 Points

    Can you please verify if ,modifications, made to function array_category are a good idea? Seems more clear to me

    Posted April 27, 2016 8:43pm by Javier MARQUEZ
    Javier MARQUEZ
    11,877 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • mohammed abdi abdulahi warsame
    mohammed abdi abdulahi warsame
    4,926 Points

    i have anew idea :)

    Posted April 24, 2016 10:37am by mohammed abdi abdulahi warsame
    mohammed abdi abdulahi warsame
    4,926 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Daniel Cudney
    PLUS
    Daniel Cudney
    Courses Plus Student 1,378 Points

    Indexing Category in php file Undefined inde

    Posted March 2, 2016 6:01am by Daniel Cudney
    Daniel Cudney
    Courses Plus Student 1,378 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Amber Hoddinott
    Amber Hoddinott
    6,494 Points

    PLEASE PLEASE!! Can someone explain this to me... i can't move forward with my learning until i understand this??!!

    Posted February 25, 2016 9:22pm by Amber Hoddinott
    Amber Hoddinott
    6,494 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    3 Answers

  • calvindiguidig
    PLUS
    calvindiguidig
    Courses Plus Student 4,388 Points

    function array_category() won't work

    Posted February 17, 2016 5:58am by calvindiguidig
    calvindiguidig
    Courses Plus Student 4,388 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Sirin Srikier
    Sirin Srikier
    7,671 Points

    I am getting this error Warning: Invalid argument supplied for foreach() in /home/treehouse/workspace/catalog.php

    Posted February 7, 2016 10:21pm by Sirin Srikier
    Sirin Srikier
    7,671 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • James Barrett
    James Barrett
    13,253 Points

    Unclear on what 'id' is doing in the functions

    Posted February 1, 2016 11:05pm by James Barrett
    James Barrett
    13,253 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

  • Ben Os
    Ben Os
    20,008 Points

    I think I did everything Alena showed in this video but I can't filter items by category

    Posted January 31, 2016 6:36am by Ben Os
    Ben Os
    20,008 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    1 Answer

  • Kenneth Luba
    Kenneth Luba
    9,781 Points

    Webpage not looking right in preview

    Posted January 21, 2016 4:18pm by Kenneth Luba
    Kenneth Luba
    9,781 Points
    • PHP
    • Build a Basic PHP Website (2018)
    • Listing and Sorting Inventory Items
    • Displaying Categories

    2 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord