PHP learning for beginners

不言
Release: 2023-03-23 11:12:01
Original
1771 people have browsed it

The content of this article is to share with you some things you need to know when you first start learning PHP. Friends in need can refer to it

In fact, I learned PHP a long time ago.
Why write it?
I recently bought a virtual machine. . .
It would be a waste not to write. Let’s just write.
PHP is a simple and easy language to learn, but many people still don’t know how to do it.
Now let me talk about php.
Let’s learn how to write A B now.
http://www.runoob.com/try/runcode.php
Check online and try it yourself

<?php
    $a=100;$b=200;    echo $a+$b;    /*$是一个定义符号,相当于C++的int P 的 long int等。但是php没有这么麻烦,$是软定义,就是他会自动识别你的类型*/
    /*echo是一个函数,是输出啦,你试试cmd里面的echo看看,很像吧。*/
    /*输出时的AB变量都要加上$符号代表他是变量*/?>
Copy after login
Copy after login

Let’s upgrade and try to see how to get the window

<?php
    if(!empty($_POST[&#39;sub&#39;]))
    {        $a=$_POST[&#39;A&#39;];        $b=$_POST[&#39;B&#39;];        /*读取上面传回来的值值*/
        echo $a+$b;        /*$是一个定义符号,相当于C++的int P 的 long int等。但是php没有这么麻烦,$是软定义,就是他会自动识别你的类型*/
        /*echo是一个函数,是输出啦,你试试cmd里面的echo看看,很像吧。*/
    }?><form action="log.php" method="post">
    A:<input type="text" name="A"><br>
    B:<input type="text" name="B"><br>
    <input type="submit" name="sub" value="提交按钮"><br></form>
Copy after login
Copy after login

The following is HTML5
This is also a must-learn
Just go back to log.php
And bring back the values ​​​​of A and B boxes
Very good.
Finished learning the basics.

Actually, I learned php a long time ago.
Why write it?
I recently bought a virtual machine. . .
It would be a waste not to write. Let’s just write.
PHP is a simple and easy language to learn, but many people still don’t know how to do it.
Now let me talk about php.
Let’s learn how to write A B now.
http://www.runoob.com/try/runcode.php
Check online and try it yourself

<?php
    $a=100;$b=200;    echo $a+$b;    /*$是一个定义符号,相当于C++的int P 的 long int等。但是php没有这么麻烦,$是软定义,就是他会自动识别你的类型*/
    /*echo是一个函数,是输出啦,你试试cmd里面的echo看看,很像吧。*/
    /*输出时的AB变量都要加上$符号代表他是变量*/?>
Copy after login
Copy after login

Let’s upgrade and try to see how to get the window

<?php
    if(!empty($_POST[&#39;sub&#39;]))
    {        $a=$_POST[&#39;A&#39;];        $b=$_POST[&#39;B&#39;];        /*读取上面传回来的值值*/
        echo $a+$b;        /*$是一个定义符号,相当于C++的int P 的 long int等。但是php没有这么麻烦,$是软定义,就是他会自动识别你的类型*/
        /*echo是一个函数,是输出啦,你试试cmd里面的echo看看,很像吧。*/
    }?><form action="log.php" method="post">
    A:<input type="text" name="A"><br>
    B:<input type="text" name="B"><br>
    <input type="submit" name="sub" value="提交按钮"><br></form>
Copy after login
Copy after login

The following is HTML5
This is also a must-learn
Just go back to log.php
And bring back the values ​​​​of A and B boxes
Very good.
Finished learning the basics.

Related recommendations:

Summary of basic knowledge of php learning


The above is the detailed content of PHP learning for beginners. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!