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 = '
$CN = MySQL tutorial _connect (' localhost ', ' root ', ');mysql_select_db (' Test ', $CN);Creating a Databasemysql_query ("Create datebase ' test ';");Creating data Tables$sql = "CREATE TABLE IF not EXISTS ' test ' (' ID ' int (8) not NULL
First step
/*First create the data table directly copy to your phpMyAdmin directly run on OK. 1
CREATE TABLE IF not EXISTS ' useradmin ' (' ID ' int (4) not NULL auto_increment,' username ' varchar default NULL,' userpass ' varchar default NULL,'
PHP's search for a database is done primarily by using like clauses in SQL statements. If you search multiple keywords at the same time, you can use the Union clause to combine the search results. The following code implements a search
Recently in doing a project, I found that in PHP, if you want to assign a value to an element of a data, you will get an error:
?
PHP
$str
=
"
222222
"
;
$var
=
Array
(A
=>
"
1
"
,
b
=>
$str
,
C
=>
""
);
if
(
$var
[b]) {
$var
[C]
=
$var
[b];}
?>
A simple example:News template file news_tmp.html:{title}{news_title}{news_image}
{news_content}______________________________________________________________________________________________Answer 7:News Generation file aaa.php:?Let's say the
Example
Comment on the expression using the label 1 to 60.
The corresponding picture path/public/images/face/1.gif to/public/images/face/60.gif.
The implementation method is to use the Preg_replace function to complete the display of the comment
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
# Display graphics and connectionsFunction showdir ($ adirectory, $ I){ Global $ browsedir;$ Start = $ I;# Changing $ maxcols and $ maximages can change the number of rows and columns of the small graph displayed on each page.$ Maxcols = 2;$
The mail () function is very simple: there are only five parameters, and two of them are optional. These parameters are:Recipient addressTopicLetter contentOther file information headers (optional)Other configuration options of the SMTP Service
The code is as follows:Copy code Function NumToStr ($ num ){If (stripos ($ num, 'E') == false) return $ num;$ Num = trim (preg_replace ('/[= \' "]/','', $ num, 1),' "'); // Scientific notation is displayed, returns a string.$ Result = "";While ($
Remember that json_encode returns a string, while json_decode returns an object.Determine that the data is not in JSON format: The code is as follows:Copy code Function is_not_json ($ str ){Return is_null (json_decode ($ str ));} Determine that
Curl can obtain the cookie Set on the returned page. The principle is the same as that of get_headers. You can retrieve the "Set-Cookie:" Content from the returned header.Test page/cookie setting page:Test. php The code is as follows:Copy code
1. Use myisam instead of innodbThe mysql tutorial has many database tutorial engines, but the most common examples are myisam and innodb.Mysql uses myisam by default. However, in many cases this is a bad choice unless you are creating a very simple
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