PHP Whitespace Insensitive

In this chapter we will study about PHP whitespace Insensitive and Case Sensitive but before we go ahead first of all we should know that what whitespace is?

Whitespace is a character which is ‘Typed’ but it remains invisible on the screen. Typically it includes space, tabs, line changes etc.

PHP is whitespace insensitive language that ignores whitespaces. This means many whitespace characters are same to one whitespace character. Check out below example the try on your text editor.

Example - 1

 $x = 'https://www.progrramers.       com   '; //Whitespace is invisible on web page
 $y = 'https://www.progrramers. com';   //both will produce same result
  echo '<a href = "">' .$x. '</a> <br />';
  echo '<a href = "">' .$y. '</a> <br />';

PHP Case sensitive

If you ever heard that PHP is case sensitive than it is true PHP is case sensitive language but there is one condition here. In PHP, all keywords like if, else, while, echo, etc., classes, functions, and user-defined functions are NOT case-sensitive. You can see yourself in below example

Example - 2

 $CAR = 'Skoda';
  echo $CAR;
  echo $car;
  echo $Car;

All the variables in PHP are case sensitive. In above example you can see that $Car, $car and $CAR are not similar.  We will study about variables in next chapter.

PHP Tutorials - Whitespace Insensitive and Case sensitive



Hello friends! Progrramers is a tutorial site of w3 programming. If you like this tutorial site please encourages us by sharing this site links with your friends and nears & dears who want to learn web development and give us like on our Facebook page. If have any question please type in to comment box or send us message on social media sites via below given social links. Thank you, have a nice learning.

Post A Comment:


  1. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    data science course in malaysia
    tableau training in malaysia
    data analytics course malaysia

  2. This is really very nice post you shared, i like the post, thanks for sharing..
    360Digitmg marketing analytics in hyderabad

  3. I found your this post while searching for information about blog-related research ... It's a good post .. keep posting and updating information. buy real instagram likes monthly

  4. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    data scientist training in malaysia