Often some friends will ask me, learning PHP has a future? Will PHP be eliminated in the future? Can PHP do anything? What can PHP do with the latter. NET can do? What is the best technology to learn? For a beginner, these problems are really
String processing
A string, called a string, is a collection of 0 or more characters, consisting of: numbers, letters, special characters, and invisible characters.
1. Escape, restore the stringStrings are often interpreted as controls, and special
Floor House de-rounding syntax format: Float floor (float value)
Returns the next integer not less than value, rounding out the fractional part of value. The type returned by floor () is still float, because the range of float values is usually
I am a novice php, only 6 months of PHP programming experience, and is under the guidance of a certified Zend Engineer to complete the work, whenever I write a script, I will pay attention to some of the details that I can do better, that is, this
PHP Paging function Backup, date 2011-09-25, fixed a few issues.
(1) When the total number of pages is 0 times the problem of calculation.
(2) When the current page is last, the problem of calculation error.
(3) When the total number of pages is
1. Direct output to the browser with Echo, print, Print_r, Var_export, or Var_dump
This situation does not appear in the middle of the page break and jump, usually followed by exit.
After the project is officially launched, these debugging code is
In PHP, Is_file and File_isexist have a very small community. 1) Is_file: $path = "/path/to/file/text.txt"; if (file_exists ($path)) echo "File Exists"; Else echo "File not Exists"; For example, in this example, the file exists will return true,
1. Download the official example package and find the example page below.
2. Locate Page.class.php and copy to your own project Thinkphp/lib/think/util below.
3.
PHP code
Public Function dopage () {
echo $_get["P"];
if (Emptyempty
Universal Cache Technology
Data cache: In this case, the data cache refers to the database query PHP cache mechanism, each time you visit the page, will first detect the corresponding cache data exists, if not exist, connect to the database, get
Cold front: Both methods are available, the first to take advantage of the built-in curl support, and the second to be more generic. It is recommended to use the second type.
Method One: Curl
function Get_onlineip () {$ch = Curl_init (http://www.ip1
Here are two questions:
1. The picture button is different from the normal button, it is necessary to use JS to simulate the commit operation.
2. When getting the button operation in PHP, the normal isset ($_post[object name]) is not available, and
1. Custom Constants
* Must be defined with function define ()
* The value can no longer be changed after the definition is complete.
* Use the constant name directly, not the same as the variable in the front plus $s
For example: Define ("PI", 3.14);
echo "My calculator"; ? >
My calculator
$num 1 = $_post[' num1 ');
$num 2 =$_request[' num2 '];
$run = $_request[' run '];
Switch ($run)
{
Case ' + ':p rint ("The sum of two numbers is:". $num 1+ $num 2));
In order to more convenient use Smarty later, we can "load Smarty template engine", "Establish Smarty object", "Set parameters of Smarty object" Three steps into a common PHP file, in the future where we need to use the place we directly reuqire,
PHP page Jump One, header () function
The header () function is a very simple way to jump a page in PHP. The main function of the header () function is to output the HTTP protocol header (header) to the browser.
The header () function is defined as
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