Now playing micro Bo more and more people, and on the microblogging of Third-party application development is more and more, oneself in the occasional contact with Sina Weibo API development, Sina micro-blog API development Resources More, Sina
Not original, set up their own class apode+ dz template + Package PDO, the application process is not to see, and the general framework syntax is the same, look at the implementation of the process, the main learning how to implement a framework,
Before looking at some PHP framework source code, very strange in the file contains, will use DirName (__file__) to patchwork file path, do not know what the benefits, then finally found the reason.
Let's look at a simple example:
There are a,b,c
has been using XAMPP to build a local PHP environment, but also before the local xampp to build and install WordPress and how to let local xampp support rewrite redirection, but recently my xampp appeared a lot of supernatural phenomenon, first
This article is a PHP in the open file fopen function of the use of a detailed analysis of the introduction, the need for friends to reference the
1.resource fopen (string $filename, String $mode [, bool $use _include_path [, Resource
This article mainly introduces the PHP with jquery implementation and deletion of specific examples, the need for friends can refer to the Background using PHP, the front desk reference jquery, to implement additions and deletions operation,
one-dimensional array sorting can be sorted by some method processes, such as Asort, Ksort, and relatively simple. How does the order of two-dimensional arrays come true? Use Array_multisort and Usort to implement For example, like the following
So we can only find a way to get webserver to call this command, usually want to improve the permissions only Su and sudo these two commands, so I put the idea on this, but the results call the two commands are still not, search on the internet to
1.json_decode ()
Json_decode
(PHP 5 >= 5.2.0, PECL json >= 1.2.0)
json_decode-strings encoded in JSON format
Description
Mixed Json_decode (String $json [, bool $assoc])
Accepts a JSON-formatted string and converts it to a PHP variable
Problem Description:
If the data entered by the user is inserted into an SQL query without processing, the application is likely to suffer a SQL injection attack, as in the following example:
The code is as follows
Examples, examples of PHP encryption decryption
Cryptographic functions:
code as follows:/*
* Function: Encrypt string to handle
* Parameter one: Content that needs to be encrypted
* Parameter two: Key
*/
function Passport_encrypt ($str,
In this article, the various ways of creating arrays are shared with PHP instance code, and interested friends can understand the Read this article before I believe that everyone has read the PHP Chinese Manual on the section of the
When I started writing PHP code, I was going to write PHP closed tags, after a few years, habits changed, no longer write PHP tags.
The concept was first approached from Drupal, and at first it was a bit of a habit-why not write a closed tag? This
This article mainly introduces PHP fopen () and file_get_contents () application and difference, need friends can refer to the followingThe code is as follows: $file =fopen ("11.txt", "R") or exit ("Unable to open file!"); /fopen Open the file, if
code as follows
/** * php Fetch path or directory implementation * @l Ink http://www.45it.com */ //Magic variable, get the absolute path of the current file echo "__file__: ========> ".
Advanced OOP techniques in PHP
After looking at basic OOP concepts, I can show you more advanced technologies:
Serialization (serializing)
PHP does not support persistent objects, where permanent objects are objects that can maintain state and
Mail ([receiver], [subject], [mail subject], [header information]);You simply need to replace the [receiver] with the next name in the list. Suppose you already have an array of email addresses:$addresses = Array ("me@mycompany.com",
1 Reputation and great wealthImagine a site that gets the latest news from the hottest portal site. Stock prices, weather information, news stories, thread discussion groups, software releases ... All of this will be dynamically updated once per
1. Str_replace
Str_replace is a commonly used PHP function, used for string replacement, often see some of the new PHP to replace a batch of strings, write a lot of lines str_replace, it is appalling.
Like this example:
Php:
$str = ' Someone's
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