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

PHP7 DATA TYPES INTEGERS FLOATS STRINGS BOOLEAN LESSON 10

Strings in PHP7

If you have been following along in our lessons we have used several strings. A string in PHP can be encapsulated with single or double quotes. A PHP string is made up of several letters, numbers and even code like HTML, javaScript and CSS. Here is an example of a string.

<?php $var="I Love PHP7" var_dump($var);?>

This is the result. When you use var_dump it returns the value and also the number of characters that are in a string.

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. 🙂

string(11) “I love PHP7”

Using Strings With Code in PHP7

You can use strings to hold code in PHP. We have done this a few times already in our lessons. Here is an example.

Subscribe To My YouTube Channel:
<?php $string='
<h3>PHP7 Is Awesome</h3>

';

echo $string; ?>

When Would I Use String in PHP7?

You will use strings all the time in PHP7. They are used everywhere and practically on every page. Creating a string is simple and easy to use, that may be why we use them so often.

string in php7 are used all the time

PHP7 DATA TYPES INTEGERS FLOATS STRINGS BOOLEAN LESSON 10 was last modified: March 9th, 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

Tips

Cool People Share:
PHP7 DATA TYPES HOW THEY ARE USED

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.