For programmers
How did Perl become famous in the business world? Its powerful regular expression. What about PHP? He is a language developed from Unix. Of course, he inherits many features of Perl and has advantages in C. Fast, concise, and clear.
The following code is an example of PHP image capturing code:
// Variable description:
// $ Url is the complete URL of the remote image. It cannot be blank.
// $ Filename is an optional variable. If it is null,The local file name is
In the previous article, we introduced how to useSeven results are displayed after the second operation.
Maybe you will ask, can PHP random numbers only do these boring things? Rand () doesn't seem so important. If you're wrong, think about the
Handle exceptions in
The following four sections of Code show my simple application (non-production environment) in the waylife project, which is neither robust nor beautifying, but the SNS project has died.
1. hierarchical relationship of exception
How to understand
By default, there is a "Magic quotes" switch in PHP. If this switch is enabled, $ _ GET, $ _ GET, and $ COOKIE transferred from outside will be escaped by PHP.For example:
Http: // localhost/test. PHP? Test = 1'
Then it is
$ Userfile_name upload document name$ Userfile_tmp_name temporary name for saving the uploaded document$ Userfile_size size of the uploaded document, in bytes$ Userfile_type the mime type of the document to be uploaded
The variables in the above
Json_encode data to JSONConversion from json_decode JSON to PHP Variables
These two php json conversion functions are particularly important when using Ajax such as jquery and Ext frameworks. Ext accepts JSON data by default, jquery makes JSON
Public: methods or attributes can be accessed in any scope, and this is the default value. If an access modifier is not specified for an attribute or method, It will be public.
Protected: A method or attribute can only be accessed from a class or a
In
? Php
$ File = 'dirlist. php ';
If (is_readable ($ file)= False ){
Die ('file does not exist or cannot be read ');
} Else {
Echo 'exist ';
}
?>
The file_exists function is used to determine the existence of the file (as
Comparing PHP and JSP Web development technologies, the current situation is actually comparing PHP and Java Web development. The following is a comparison of several main aspects:
I. Language Comparison
PHP is the server script language for
We usually use
When using header ("location: test. PHP") in php for redirection, pay attention to the following points, which helps solve some problems frequently encountered by new users.
1. There must be no space between location and:. Otherwise,
There are three main formats for saving PHP File Cache content:
1. The variable var_export is formatted as a normal PHP value assignment format. When used, the file is directly included.
2. The variable serialize is saved after serialization and
PHP array_walk () function definition and usage
The PHP array_walk () function applies a callback function to each element in the array. If the call succeeds, TRUE is returned. Otherwise, FALSE is returned.
In typical cases, a function accepts two
We are
1. The origin of the template
Before using the template technology, PHP development programs are usually compiled together with php code and html. For example, the news list is probably a newslist. php page with the following structure:
?
If we encounter a constant value that cannot be changed in actual programming, a constant is usually defined to use this constant value. Then we use
When defining a constant, we can use const to modify the constant. The constant modified with PHP
Many programmers are using
Note: This document is based on the include description, but also applies to require. These two structures are exactly the same except for how to handle include failures: When the include () fails, include () generates a
We will give you a detailed introduction here.
The reason for using these PHP encryption and decryption is that sometimes your URL address is obtained and you want to crack the content that passes the value in your URL, you must know your key, no
Implementation
The first PHP drop-down box implementation method:
? Php
// Submit the drop-down list;
// The result of triggering the onchange event
$ Id = $ _ GET ['myselect']; // myselectIs location. herf? Id;
Echo $ id;
// Results
In this article, we mainly talk about some
Plug-ins, that is, Plug-in, refer to a specific type of functional modules (usually implemented by third-party developers). They are characteristic of activating a Plug-in when you need it, disable/delete a
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