1 00:00:01 --> 00:00:04 Hi and welcome to a basic PHP tutorial. 2 00:00:05 --> 00:00:09 I'll just go through how to use the "echo" function and how to set up your tags . 3 00:00:10 --> 00:00:17 Those of you that are familiar with "html" will know that there are html tags to start your page and to end your page. 4 00:00:18 --> 00:00:24 They're not vital in an html page. As long as you've got an html extension, you're fine. 5 00:00:25 --> 00:00:29 However, in PHP, you need the tags. This starts and this ends. 6 00:00:30 --> 00:00:33 That's basically the standard notation for it. 7 00:00:34 --> 00:00:38 However, our content goes in between here. 8 00:00:39 --> 00:00:42 Now, I've already saved my file as "helloworld.php". 9 00:00:43 --> 00:00:46 So, let's save that and have a look in here. 10 00:00:47 --> 00:00:53 Okay, there's nothing in the page at the moment but we've got our page set up. It's absolutely fine. 11 00:00:54 --> 00:01:02 The "echo" function works like this: we've got echo, we've got some double quotes and we've got a line terminator which is the semicolon mark. 12 00:01:03 --> 00:01:08 And our text goes in between here. Let's save that and we'll refresh. And there we go. 13 00:01:09 --> 00:01:15 Right, you can – and I find this very useful – write your "echo" function like this. 14 00:01:16 --> 00:01:33 Because when you put an html code inside your echo function these bits here don't represent line breaks. (and just to let you know, if you haven't learnt html yet I suggest you pick it up, at least the basics, because we're going to be using it quite a lot) 15 00:01:34 --> 00:01:42 For that you need to add your own html in. So '' for line break and then 'New line'. 16 00:01:43 --> 00:01:47 We'll refresh this and there you go! Our html has been incorporated. 17 00:01:48 --> 00:01:56 Okay, just to let you know, this is one thing that a lot of people run into: 'image source equals' and your file goes there. 18 00:01:57 --> 00:02:00 However, at the moment we've got 'echo'. 19 00:02:01 --> 00:02:06 This shows that we're going to start our output and this here will show that we're ending our output. 20 00:02:07 --> 00:02:10 We don't end it here; we're going to end it here. 21 00:02:11 --> 00:02:13 So instead of these, we'll need inverted commas. 22 00:02:14 --> 00:02:17 Basically, that will let us show our image there. 23 00:02:18 --> 00:02:20 There's no file specified, but you get the picture. 24 00:02:21 --> 00:02:27 So, let me just show you what would happen if we keep these in and then with that I'll end the tutorial. 25 00:02:28 --> 00:02:30 Right, we've got 'Parse error'. 26 00:02:31 --> 00:02:39 We either need a comma or a semicolon to end, which proves that as we're coming up to here, we need a semicolon after this. 27 00:02:40 --> 00:02:41 But in actual fact, that's not true. 28 00:02:42 --> 00:02:44 So, just keep them as inverted commas. 29 00:02:45 --> 00:02:51 Okay, that's the basics of the echo function and the PHP tags. Hope you enjoyed learning them. 30 00:02:52 --> 00:02:57 Thanks for watching! This script has been translated by ---------------------------(translator's name) and this is -----------------------------------(narrator's name) signing off.