The code is as follows
Copy Code
Var_export ($times, true); Cannot write to file after not adding true yo$fp = fopen (' aa.txt ', ' w+ ');Fwrite ($fp, Var_export ($times, true));Fclose ($FP);
Method Two
Using Serializ and
The code is as follows
Copy Code
/** File: chinesechar.php* Role: Chinese character data storage*/$ChineseChar = Array ("Man", "Out", "Come", "friend", "Learn", "filial piety", "benevolence", "righteousness", "propriety," low ","
GrammarMD5 (STRING,RAW)
MD5 () function computes the MD5 hash of the string
String required. Specify the string to be evaluated
Charlist
Optional. Specify hexadecimal or binary output formats:TRUE-Original 16 character binary formatFALSE-Default.
Note: Find php.ini in Windows directory Open edit, search Mbstring.dll, findExtension=php_mbstring.dll the front of the number, so the MB_SUBSTR function can be effective
Example
The code is as follows
Copy Code
$str = '
To use curl, you need to set up php.ini >
Extension=php_curl.dll
Removing the previous comment is both available.
The implementation code is as follows:
The code is as follows
Copy Code
$curl = Curl_init ();$url = '
Share the methods I have used. Valid for PHP tutorial myadmin exported SQL files only
$dbfile = "Test.sql";$content =iconv ("Utf-8", "gb2312", file_get_contents ($dbfile));Get the data createdRemove comments$content =preg_replace ("/--. *n/iu", "",
This article illustrates the simplest method of string matching in PHP, which is implemented as follows:
The code is as follows
Copy Code
/*The simplest string matching algorithm PHP implementation methodT:ababcabcP:abc0.1
So far, we have been able to use GD to complete the basic needs of plotting. However, sometimes it may be hard to think of ImageString.The five fonts that can be used are few and ugly, so we need to use the following functions. This function allows
Simple session creation The code is as follows:Copy code Session_start ();$ Username = "nostop ";Session_register ("username ");?> In this example, we registered a variable named username with the value of nostop to the session.Read
Syntax: void set_time_limit (int seconds)Note: When PHP is executed in safe mode, set_time_limit () will not produce any results, unless it is disabled in safe mode or modified in the structure file (in PHP3, it is called php3.ini, PHP4 is called
The code is as follows:Copy code Class Person{Private $ __data = array (); Public function _ get ($ property) {If (isset ($ this->__ data [$ property]) {Return $ this->__ data [$ property]; }Else {Return false; } } Public function _ set ($
Uploadimg. class. Php file The code is as follows:Copy code Class upload{ Var $ upload_name;Var $ upload_tmp_address;Var $ upload_server_name;Var $ upload_filetype;Var $ file_type;Var $ file_server_address;Var $ image_w = 900; // The width of
*/ The code is as follows:Copy code $ Link = @ mysql_connect ($ db_host, $ db_user, $ db_pass) or die ('unable to establish a db connection ');Mysql_query ("set names 'utf8 '");Mysql_select_db ($ db_database, $ link );Class comment{Private $
If (! Isset ($ _ session) session_start ();/** 2010-6-22* $ The data array type contains the following variables:-------------------------------* $ Sub_type submit type (upload: upload button delete: delete button), default upload* $ File the $ _
Browser cache is totally different. The cached content is stored locally in the browser, but the content is generated by the web server. Neither party can complete this system process independently, therefore, there must be a communication mechanism
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