Posted on 2005-03-24
Medium Priority
Last Modified: 2012-08-14
I am learning php and it says whitespace are ignored.
ok, I see that, put can some one tell me why the spaces between " Welcome" and "to" are ignored and the other spaces between the other words are not.

<?php echo '<hi Welcome           to john's car lot</h1>'; ?>
Question by:starview
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 18

Accepted Solution

arantius earned 1000 total points
ID: 13627686
In HTML, whitespace is collapsed.  One space, or a million spaces, it's all the same.
That does not mean it is ignored, it means the second and on whitespace character in a row is ignored.  This is also generally but not always true within PHP scripting as well as HTML.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question