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
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 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,
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
1. References to variables
PHP refers to a two-variable pointer to the same memory address
$a = "ABC";
$b =& $a;
echo $a//Here output: ABC
echo $b//Here output: ABC
$b = "EFG";
echo $a//Here the value of $a becomes EFG so output EFG
echo
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
This article mainly introduces the PHP detection useragent version of the example, the need for friends can refer to the following Code as follows: <?php define (' IE ', 1); Define (' FIREFOX ', 2); Define (' CHROME ', 3); Define (' OPERA ',
Before I gave a page to show the MySQL record class, but did not give the use of the example, now, I have just written an online auction system framework program to illustrate the use of this class, but also on the online auction implementation
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
This is a simple voting procedure, for just learning PHP and friends is a very good starter program. Here to introduce you, hope to be able to help friends.
The system is composed of the following four files: The survey.htm of the HTML survey form,
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