Example 1
Custom Methods Merge Arrays
First look at a two-dimensional array:
The code is as follows
Copy Code
Array ( [0] => Array ( [A] => store_name [B] => Store A ) [1] => Array ( [A] => Store_owner [B] => small
You can use the shuffle function in PHP to implement the array random sorting function.
The code is as follows
Copy Code
$test =array (); $test []=array ( ' title ' => ' Q1.) What is the more scientific
Configure php1. Open php. in and remove the annotation symbol of extension = php_mssql.dll.2. Open php. in and change mssql. secure_connection = Off to on.3. Copy php_mssql.dll to the directory specified by extension_dir in php. in or the system32
Lt; html> $ Id = @ mssql_connect ("ddy", "sa", "") or die ("unable to connect ");$ Db = mssql_select_db ("ddy", $ id );$ Query = "select * from lr00 order by lr0012 desc ";$ Result = mssql_query ($ query );If ($ result ):If ($ tt = ""){$ Nopa = 0 ;}
The code is as follows:Copy code $ Xml = simplexml_load_file ('http: // www.google.com/ig/api? Weather = Changsha ');$ Information = $ xml-> xpath ("/xml_api_reply/weather/current_conditions/condition ");Echo $ information [0]-> attributes ();?>
Step 1: Use the json_encode () function to convert data to json data. The code is as follows:Copy code // JSON format data is represented by arrays in php.$ Arr = array ('Firstname' => iconv ('gb2312', 'utf-8', 'sincerity '),'Lastname' => iconv (
The code is as follows:Copy code // Function name: ExchangeMoney ($ N_money)// For use: capital conversion function// Parameter: $ N_money (number of the amount to be converted)// Return value: string// Standby note: This function example: $
The solution is as follows: join array and index array can be used The code is as follows:Copy code Function array_shuffle ($ array){// Not an arrayIf (! Is_array ($ array )){Return array (); }// If it is null or there is only one itemIf ($
Example: obtain the date of the previous day from January 1,. The code is as follows:Copy code // Convert a time point to a timestamp$ Date = strtotime ('2017-5-1 ');// Output the date before the day, minus the number of seconds of the day in
First LookChr functionThe chr () function returns characters from the specified ASCII value.Chr (ascii)Ascii parameters can be decimal, octal, or hexadecimal. You can specify the octal ratio by using the frontend 0 and the hexadecimal value by using
The code is as follows:Copy code /*** Paging functions* * @ Param int $ count total number of entries* @ Param int $ perlogs number of entries displayed per page* @ Param int $ page current page number* @ Param string $ url address of the page
The code is as follows:Copy code $ File = "C:/Users/Public/Music/Sample Music/kalimbaloud "; If (! File_exists ($ file )){Exit ('media file does not exist .');} // Create a Windows Media Player interface$ Player = new COM ("WMPlayer. OCX ");$
The code is as follows:Copy code Function tranTime ($ time ){$ Rtime = date ("m-d H: I", $ time );$ Htime = date ("H: I", $ time ); $ Time = time ()-$ time; If ($ time $ Str = 'gang '; } Elseif ($ time $ Min = floor ($ time/60 );$ Str = $
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