1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)

Data Types In Php 7 Objects Arrays Null Resource Lesson 11

Data Type NULL in PHP7

The Data Type NULL in PHP7 only holds one value and that is NULL. NULL is basically nothing, it means that nothing is in that data string. Here is an example. Let’s set the $var=’PHP7′ and then we will change the variable to NULL then echo it out on the page.

<?php $var='PHP7'; echo $var; echo '<br>'; $var=null; echo $var ?>

As you  can see the variable $var was emptied and nothing is being echoed out in the second $var. If a variable is created with nothing in it is it automatically assigned NULL.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

How Do We Use NULL in PHP7 Applications?

We use NULL to store nothing in a variable. However we do not put the term NULL in the variable we just leave it empty. In the future when you are working with loops you may set a variable to NULL and then fill it with some other data.

null is nothing in PHP7

Subscribe To My YouTube Channel:
Data Types In Php 7 Objects Arrays Null Resource Lesson 11 was last modified: March 10th, 2019 by Maximus Mccullough

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips


Cool People Share:

Pages:Previous 1 2 3 4 Next

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.