PHP programs that change the Internet (1 ). From database management to online shopping, from blogs to emails, there are countless open-source PHP programs. Over the past decade, there have been countless open-source PHP programs, from database
Reveal the technology behind Digg. Brief translation of NoSQLFan: 1. services provided by Digg: a social news website is a private social news publishing platform, an advertisement platform, and an open NoSQLFan for individuals. brief translation:
PHP obtains the visitor's IP address
Obtain the visitor's IP address [PHP] code
Static public function getip ()
{
If (getenv ("HTTP_CLIENT_IP") & strcasecmp (getenv ("HTTP_CLIENT_IP"), "unknown "))
{
$ Ip =
PHP encapsulates a database mysql class
// Configure the database
Define ('Db _ host', '127. 0.0.1 '); // server address
Define ('Db _ user', 'root'); // USER name
Php obtains the day of the week or a certain date.
Effect: today is: Friday is: Sunday [PHP] code
Function getWeekName ($ data, $ format = 'week ')
{
$ Week = date ("D", $ data );
Switch ($ week)
{
Php5 object replication, clone, Shap replication, and deep replication
Origin of object replicationWhy does an object have the concept of "copying", which is closely related to the object value passing method in PHP5. let's take a look at
PHP download file code [customizable]
Use the get method to pass in the http: // domain/download. php? parameter? File = 'savepath on server' & name = 'File name you want'
// Input the file path and file name,
Filter dangerous html code in form submission using php
PHP filters the html code of the submitted form, which may be exploited to introduce external dangerous content. For example, some forms submitted by the user contain html content, but
Use of PHPZip
Class PHPZip
{
Function Zip ($ dir, $ zipfilename)
{
If (@ function_exists ('gzcompress '))
{
$ Curdir = getcwd ();
If (is_array ($ dir ))
{
$ Filelist = $ dir;
}
PHP code for sending emails using mandrill
Mandrill is a powerful SMTP provider. Developers tend to use a third-party SMTP provider for better delivery. In the following function, you need to put "Mandrill. php" in the same folder as a PHP
PHP can detect the code snippets of the language used by the user's browser.
Use the following PHP code snippet to check the language used by your browser
Function get_client_language ($ availableLanguages, $ default = 'en '
Obtain the PHP code of the country using the IP address
Function getLocationInfoByIp (){
$ Client = @ $ _ SERVER ['http _ CLIENT_IP '];
$ Forward = @ $ _ SERVER ['http _ X_FORWARDED_FOR '];
$ Remote =
Php regular expression to retrieve all links to content
This example describes how to obtain all links of the content using a php regular expression. Share it with you for your reference. The details are as follows: Here we provide two
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