The basic use of this article includes :

  • php Conventional grammar
  • date,number,array And so on

The general syntax of programming language is easy to understand , Almost the same . If you're a programmer good at other interpretive languages , Migrate to php It's almost effortless . And vice versa .

And this is the process of migration , Personally, I don't think it's a learning process , It's a process of use . because , We just have one more tool , form , There's no improvement in the nature of programming . I can't talk about it at my own level , Now get into basic use .

Reference book or cheatsheet

  • What is? ‘cheatsheet'
  • php cheatsheet

Print hello world

echo "hello world";

Defining variables

//define vars
$vars = "123";
// Constant PI
  • There is no dollar sign before the constant ($);
  • Constant can only be used define() Function definition , Instead of using assignment statements ;
  • Constants can be defined and accessed anywhere, regardless of the scope of the variable ;
  • Once a constant is defined, it cannot be redefined or undefined ;
  • The value of a constant can only be scalar .


  • if
  • switch
  • while/do while
  • for

Random recommendation

  1. WPF Custom search box

      Search icon download address in control : The search box design process is relatively simple : 1. So let's define one Rectangle As a background 2. ...

  2. java English word frequency algorithm

    java Implementation of the English word frequency algorithm , It's usually implemented with a word tree . Use java Realize word frequency statistics , In order to count the frequency of words , The easiest way is to build another map, among ,key Is the word ,value Number of Representatives . Read the article from the beginning to the end , Read one ...

  3. android Play voice file appears prepare failed , Can't download amr file

    amr The path to the file is correct , however android But it can't play . Debugging found that there is no download down reason : IIS The server is not allowed to download the file , Need configuration MIME resolvent : Get into IIS Catalog , To configure MIME

  4. javaweb Learning summary one (eclipse Common shortcut key 、debug Commissioning and junit The test framework )

    One :web Development trend of 1:C/S( client / The server ) Structural direction B/S( browser / The server ) Structural development , Later computers only need operating system and browser . All services are stored on the server side , Just log in and synchronize data from the server , for example : You don't have to ...

  5. Handler Do you have to instantiate in the mainline ?new Handler() and new Handler(Looper.getMainLooper()) The difference between ?

    The arrangement of a post : Handler Do you have to instantiate in the mainline ?new Handler() and new Handler(Looper.getMainLooper()) If you instantiate without parameters :Handler ...

  6. phpMyAdmin import.php Cross-site scripting vulnerability

    Vulnerability name : phpMyAdmin import.php Cross-site scripting vulnerability CNNVD Number : CNNVD-201402-281 Release time : 2014-02-21 Update time : 2014-02-21 Hazard rating : ...

  7. AE+SceneControl Source code sharing

    Recently , Bloggers send private messages or email exchanges , Before the first use SceneControl Do it for me project Stocks , It's rough . We hope to help you , Welcome to leave a message . Except for the main drive . preservation . Data loading . inquiry , The main functions are ...

  8. HTML5 And Audio Audio tag learning

    HTML5 New element tags in src: Audio file path . autobuffer: Set whether to automatically buffer audio when the page is loaded . autoplay: Set whether the audio will play automatically . loop: Set whether to loop the audio . control ...

  9. A fast 、 efficient Levenshtein Algorithm implementation —— Code implementation

    I saw a blog explanation on the Internet Levenshtein The calculation of , Most of the content is very good , It's just not good enough in some details , It took a long time to understand . I made a simple modification to the algorithm description . The link to the original is : A fast . efficient Levensht ...

  10. CF 604C Alternative Thinking# greedy

    (- ̄▽ ̄)-* #include<iostream> #include<cstdio> #include<cstring> using namespace std ...