PhP Echo
Hey guys, today I'm going to show you how to make a string in PHP using the "echo" command. Lets get started.
First off we need XAMMP or a webhost to try this out on, I recommend using a webhost like 000webhost, ((Free host here)) . Register or Login to view. if you don't already have XAMMP installed. I might later publish a tutorial on how to install XAMMP.
Ok, now we need a text editor I recommend Dw (Dream Weaver) or Notepad++. But yes, a simple notepad will work also!
Now, that we have all our acquirements nessecary to perform this, let's get to the real coding.
First off you're going to need to start and end your PHP using this:
PHP Code:
- Code:
-
<?php
?>
You will place your PHP code inbetween that.
Now, we will make our string using the echo. Like so:
PHP Code:
- Code:
-
<?PHP
echo 'This is a string.';
?>
Great, so far our code should look like this:
- Code:
-
PHP Code:
<?php
echo 'This is a string.';
?>
Now, if you would save that as "String.php" and veiw it in your webhost or your XAMMP local host. It would show up as "This is a string." in the top left hand corner of the browser.