Mobile App Interface Programming technology-learning to implement PHP advanced functions

Source: Internet
Author: User
    • function definition and invocation method
PHP函数的定义方式:    1.使用关键字“function”开始2.函数名可以是字母或下划线开头:functionname()3.在大括号中编写函数体:    functionname(){        //函数体        echo 'Eric';    }    调用方法为函数名+参数,例如:name();
    • function that returns a value

      Use the return keyword to return a value to a function that returns any type that includes an array and an object, or NULL if the return is omitted.


    
     functionsum($a, $b) {return$a+$b;}//在这里调用函数取得返回值/** * 初始化数组函数 */functioninitArray(){$arr = array('o'=>'哦');    return$arr;}$s = sum(1,2);print_r($s.'
');$arr = initArray();print_r($arr['o']);?>

The above describes the mobile app interface programming technology-learning to implement the PHP advanced function, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.