Skip to main content

NOTICE: On Friday Nov 6, Workspaces will be temporarily unavailable for maintenance.

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

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

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
  • Robert Bourton
    Robert Bourton
    4,751 Points

    Why the new line when its in the browser?

    Posted July 2, 2024 10:57pm by Robert Bourton
    Robert Bourton
    4,751 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    3 Answers

  • Carlos Zuluaga
    Carlos Zuluaga
    21,184 Points

    The value echo for the final rounds taken always brings 0 (initial value)

    Posted January 1, 2023 6:46pm by Carlos Zuluaga
    Carlos Zuluaga
    21,184 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    2 Answers

  • Anastasia Khmelevskaya
    Anastasia Khmelevskaya
    1,775 Points

    Syntax error although I wrote the code exactly as in the video

    Posted January 11, 2021 9:33pm by Anastasia Khmelevskaya
    Anastasia Khmelevskaya
    1,775 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    2 Answers

  • Door Man
    Door Man
    1,711 Points

    each() being deprecated.

    Posted June 10, 2020 4:09pm by Door Man
    Door Man
    1,711 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    2 Answers

  • yahya alhalki
    yahya alhalki
    1,149 Points

    why do we have to put parentheses round ($player1 < 11 && $player2 < 11) )?

    Posted May 2, 2019 6:42am by yahya alhalki
    yahya alhalki
    1,149 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    2 Answers

  • Alexei Parphyonov
    Alexei Parphyonov
    34,128 Points

    Wrong number of rounds in the video though the same code works correct on my Mac

    Posted January 13, 2019 9:56am by Alexei Parphyonov
    Alexei Parphyonov
    34,128 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    1 Answer

  • nathan goel
    nathan goel
    7,410 Points

    I guess I don't really understand && and ||...help please

    Posted December 30, 2018 2:38pm by nathan goel
    nathan goel
    7,410 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    1 Answer

  • Yoel Dovid Cohen
    Yoel Dovid Cohen
    13,405 Points

    Workspaces Not working

    Posted December 25, 2018 7:04pm by Yoel Dovid Cohen
    Yoel Dovid Cohen
    13,405 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    1 Answer

  • Emil Pesaxov
    Emil Pesaxov
    3,684 Points

    Cannot understand the while loop code.

    Posted July 4, 2018 3:24pm by Emil Pesaxov
    Emil Pesaxov
    3,684 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    1 Answer

  • Waqar Mohammad
    Waqar Mohammad
    2,914 Points

    The rules of the game state to win a round you need 11 as a minimum score, but the output is not requiring that.

    Posted October 31, 2016 2:42pm by Waqar Mohammad
    Waqar Mohammad
    2,914 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    3 Answers

  • Jonathan Grieve
    Jonathan Grieve
    91,254 Points

    PHP: Ping Pong Simulation Game

    Posted September 3, 2016 12:18pm by Jonathan Grieve
    Jonathan Grieve
    91,254 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    1 Answer

  • Aaron Coursolle
    Aaron Coursolle
    18,014 Points

    Very minor error in video...

    Posted August 18, 2016 2:27pm by Aaron Coursolle
    Aaron Coursolle
    18,014 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    0 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