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

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

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

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

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

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • 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
    • Showing results for:
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong
    • Close
  • Robert Bourton
    Robert Bourton
    4,751 Points

    Why the new line when its in the browser?

    Posted on Jul 2, 2024 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 on Jan 1, 2023 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 on Jan 11, 2021 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 on Jun 10, 2020 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 on May 2, 2019 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 on Jan 13, 2019 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 on Dec 30, 2018 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 on Dec 25, 2018 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 on Jul 4, 2018 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 on Oct 31, 2016 by Waqar Mohammad
    Waqar Mohammad
    2,914 Points
    • PHP
    • PHP Arrays and Control Structures
    • PHP Loops
    • Ping Pong

    3 Answers

  • Jonathan Grieve
    MOD
    Jonathan Grieve
    Treehouse Moderator 91,254 Points

    PHP: Ping Pong Simulation Game

    Posted on Sep 3, 2016 by Jonathan Grieve
    Jonathan Grieve
    Treehouse Moderator 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 on Aug 18, 2016 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.

    Treehouse

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

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.