Sample code
The code is as follows
Gets the first and last day of the month on which the specified date is locatedfunction Getthemonth ($date) {$firstday = Date ("y-m-01", Strtotime ($date));$lastday = Date ("y-m-d",
below to share a PHP implementation of unlimited column category reading examples, I hope that the article will bring help to you The idea of realizing infinite pole column classification: Get the ID (that is, the parent ID) and then get the
This article mainly introduced the PHP to obtain the file size method, needs the friend may refer to underThe code is as follows: static function convert ($size) {$unit =array (' B ', ' KB ', ' MB ', ' GB ', ' TB ', ' PB '); Return @round ($size/pow
This article mainly introduces the website judgment is the mobile phone access or the computer access, then displays the different information, everybody references uses the bar The code is as follows:
This article mainly introduces the PHP traversal and print all the file instances under the specified directory, you need friends can refer to the following Code as follows:
content= "text/html; charset=utf-8"/> untitled document
Id
Value
$link = mysql_connect ("localhost", "root", ""); Connecting to a database
mysql_select_db ("CS");//Select which database
mysql_query ("Set names Utf-
PHP Verification code picture can not output
FileName global_func.php
function _code () {
Run Verification Code
Number of code with the notation
$_rnd_code=4;
For ($i =0 $i
$_nmsg.=dechex (Mt_rand (0, 15));
}
Save in session
$_session['
1. To determine whether a URL can be normal access, to avoid the use of file_get_contents, because the URL can not access, and a fatal error, terminate the program problem.
$url = ' http://www.veryhuo.com ';
$ch = Curl_init ();
$timeout = 10;
Micro-letter is now a fire, around the application of micro-credit development is more and more, some time ago, their company needs to write a micro-letter PHP application, in order to prevent their hard written PHP application is stolen, so through
This example tells the PHP realization obtains the picture color value the method, the PHP obtains the picture color value detection picture main color is through the Imagecreatefromjpeg function reads the picture, then circulates obtains each color
The PDO extension defines a lightweight, consistent interface for the PHP Access database that provides a data access abstraction layer so that queries and data can be executed through consistent functions, regardless of the database used.
In some
The Narcissus number refers to an n-digit (n≥3), in which the sum of the n powers of the number on each bit is equal to itself. (For example: 1^3 + 3^3+ 5^3 = 153) This article mainly introduces the realization of the number of daffodils in PHP 4
The first step is to get the coordinates
";//Google HQ
$PREPADDR = Str_replace (', ' + ', $address);
$geocode =file_get_contents (' http://maps.google.com/maps/api/geocode/json?address= '. $prepAddr. &sensor=false ');
$output = Json_decode
The Fibonacci sequence is usually done recursively, and of course there are other methods. Now learn to sell, use PHP iterator to implement a Fibonacci sequence, almost no difficulty, but the class of the next () method rewrite once. Comments have
1. Binary Lookup-Binary insertion SortComplexity of Time: O (n^2)Applicable conditions: Relatively direct insertion of the sort, reducing the number of comparisons. Suitable for situations where there is less digital than the sort required.1PHP2
What do I need to learn when I start to develop public accounts ?, Public information
Public platform development-OAuth2.0 webpage authorization interface and webpage authorization interface (including source code)Author: Meng xianglei-public
A historic and epoch-making moment !, HistoricalNarration:
Today is the first day of blog activation!
In fact, I have been learning front-end knowledge for quite a long time (after graduation, I took the time to learn it). I learned HTML, CSS,
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