Home  >  Article  >  Backend Development  >  Learn PHP from scratch - Day 4

Learn PHP from scratch - Day 4

WBOY
WBOYOriginal
2016-08-08 09:25:24922browse

Writing this series of articles is mainly to urge myself to digest some knowledge regularly and quantitatively every day!

At the same time, it is also to let people who need it learn something~!

My skills are really not very high! There may be errors in this article! I hope you can remind me and everyone when you find out!

Secretly, the final goal of this tutorial is to implement a PHP framework (although it may be far away for me!~)

We set up a virtual host yesterday and ran it successfully

Today I will write a program in this virtual host

The virtual host built last time is in the directory upupw/vhosts/www.test.local (the following www.test.loacl is the domain name of the virtual host you built in the previous lesson)

We first use PHPstrom to open our upupw/vhosts/www.test.local

First choose to open the directory

Then I opened this project

Create a new PHP file. We call it lesson1.php (translation lesson: lesson, course)

After clicking

After creating it, click on the file to enter the editing mode of the file

1. The first command echo

  Echo is an output statement in PHP, which can output a string. The string is enclosed in quotation marks

 For example

<?php
echo 'hello world';

In this way, the page will output a hello world

Don’t believe it? Give it a try?

 

Note that ";" must be added after every command in PHP. Don't forget it! ~

The above introduces the fourth day of learning PHP from scratch, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn