Learn the PHP knowledge points for the source of Yii framework

Source: Internet
Author: User
Tags yii

Constant


Pre-defined constants:
__DIR__: Returns the directory where the current file resides. Returns the directory where the contained file is located if it is in the included file. Note: Unless the current directory is the root directory, the returned string is not followed by A/
__FILE__: Returns the path and file name of the current file. If the included file path and filename are returned in the included file

Variable

Pre-defined variables:

$_server:http://php.net/manual/zh/reserved.variables.server.php

Function


DirName: Returns the parent directory in the given path. If no/is returned in the given path. Represents the current directory, otherwise returns the remaining string after the last/and subsequent string in the given path is removed

STRNCMP ($str 1, $str 2, $len): Compares several characters at the beginning of a two string. If $STR1 is greater than $STR2 returns greater than 0, $str 1 less than $STR2 returns less than 0. Equal return 0

substr_compare:http://php.net/manual/zh/function.substr-compare.php

Strpos: Find where the string first appears

SUBSTR: Returns a substring of a string

RTrim: Delete whitespace characters (or other characters) at the end of a string

Func_get_args: Returns an array containing a list of function arguments

Array_shift: Moves the cell at the beginning of the array to a group

Get_class: Returns the class name of the object

Realpath: Returns normalized absolute pathname, failure returns false (e.g. file does not exist)

Is_dir: To determine whether a given file name is a directory, is to return true, not to return false

Date_default_timezone_set: Sets the default time zone for all datetime functions in a script

Method_exists: Checks whether the method of the class exists. If the class is not known, the auto-load function is called

Strlen: Gets the length of the string. Returns 0 if the string is empty

Explode: Splitting another string with one string

str_replace:http://php.net/manual/zh/function.str-replace.php

Ucwords: Converts the first letter of each word in a string to uppercase

Type

String

Single quote: ' to express ' need to add backslash \ Escape. Express backslash \ Self with two backslashes \ \

Reflection

http://php.net/manual/zh/book.reflection.php

Learn the PHP knowledge points for the source of Yii framework

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.