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
  • Mohammad Rifqi
    PLUS
    Mohammad Rifqi
    Courses Plus Student 3,218 Points

    help : my code diplaying 10 shirts

    Posted December 22, 2015 3:28am by Mohammad Rifqi
    Mohammad Rifqi
    Courses Plus Student 3,218 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • Rifqi Fahmi
    Rifqi Fahmi
    23,164 Points

    can anyone gimme references about += or -= or .=??

    Posted December 18, 2015 4:18am by Rifqi Fahmi
    Rifqi Fahmi
    23,164 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    2 Answers

  • Sandro Meschiari
    Sandro Meschiari
    18,418 Points

    loop shirts homepage

    Posted June 18, 2015 8:22am by Sandro Meschiari
    Sandro Meschiari
    18,418 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • William J. Terrell
    William J. Terrell
    17,403 Points

    Understanding the Code in the "Working with Functions" Quiz

    Posted June 1, 2015 6:32pm by William J. Terrell
    William J. Terrell
    17,403 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • jason chan
    jason chan
    31,009 Points

    So how does for loop work?

    Posted May 25, 2015 7:17pm by jason chan
    jason chan
    31,009 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • Mark VonGyer
    Mark VonGyer
    21,239 Points

    How did he know?!

    Posted April 30, 2015 11:02am by Mark VonGyer
    Mark VonGyer
    21,239 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    2 Answers

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

    Explain me the displaying four shirts in layman terms

    Posted April 26, 2015 11:47pm by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • Viki Pattanaik
    Viki Pattanaik
    6,314 Points

    I was taught you cannot use global variables by default insidea function without specifying globals inside the function

    Posted April 3, 2015 3:27am by Viki Pattanaik
    Viki Pattanaik
    6,314 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    3 Answers

  • Kelvin Atawura
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Kelvin Atawura
    Front End Web Development Techdegree Student 19,022 Points

    is there any other way to display the last 4 items

    Posted March 23, 2015 11:47pm by Kelvin Atawura
    .a{fill-rule:evenodd;}techdegree
    Kelvin Atawura
    Front End Web Development Techdegree Student 19,022 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • Bob Sutherton
    Bob Sutherton
    20,160 Points

    What is the purpose of starting with a blank variable?

    Posted March 18, 2015 7:00pm by Bob Sutherton
    Bob Sutherton
    20,160 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    2 Answers

  • Luis S
    Luis S
    5,451 Points

    Isn't better to echo the last items on the array like this?

    Posted March 12, 2015 10:44pm by Luis S
    Luis S
    5,451 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

  • Placid Rodrigues
    Placid Rodrigues
    12,630 Points

    Reason for using different approaches in showing the list of products in index and shirts pages.

    Posted February 25, 2015 4:39pm by Placid Rodrigues
    Placid Rodrigues
    12,630 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    0 Answers

  • Steven Griffiths
    Steven Griffiths
    3,165 Points

    How does changing the last four shirts' order work?

    Posted November 7, 2014 11:53am by Steven Griffiths
    Steven Griffiths
    3,165 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    2 Answers

  • Giovanni Valdenegro
    Giovanni Valdenegro
    13,871 Points

    Displaying only four shirts

    Posted July 3, 2014 6:09pm by Giovanni Valdenegro
    Giovanni Valdenegro
    13,871 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    4 Answers

  • M Fen
    M Fen
    9,858 Points

    PHP: Displaying only four shirts

    Posted May 18, 2014 6:32pm by M Fen
    M Fen
    9,858 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    2 Answers

  • Nic Henstridge
    Nic Henstridge
    2,107 Points

    8 Shirts still displaying

    Posted May 13, 2014 8:57am by Nic Henstridge
    Nic Henstridge
    2,107 Points
    • PHP
    • Build a Simple PHP Application
    • Working With Functions
    • Displaying Only Four Shirts

    1 Answer

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