Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
devwiki:php [2021/12/14 17:40] – [Python to Php] ying | devwiki:php [2022/11/16 16:16] (current) – [Python to Php] ying | ||
---|---|---|---|
Line 16: | Line 16: | ||
// sort array | // sort array | ||
sort($my_list); | sort($my_list); | ||
+ | </ | ||
+ | |||
+ | * unicode data insert, make sure | ||
+ | - database table' | ||
+ | CREATE TABLE info_table ( | ||
+ | id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, | ||
+ | name varchar(50) NOT NULL, | ||
+ | edit_time DATETIME NOT NULL | ||
+ | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
+ | </ | ||
+ | - make sure database connect is set to utf8mb4 mode in php before query and insert< | ||
+ | mysqli_set_charset($con, | ||
+ | </ | ||
+ | - make sure charset is declared in html < | ||
+ | <meta http-equiv=" | ||
</ | </ | ||
====== Php Date and Time Related ====== | ====== Php Date and Time Related ====== | ||
Line 53: | Line 68: | ||
| | res_list.append(tmp_img) | array_push($res_list, | | | res_list.append(tmp_img) | array_push($res_list, | ||
| | | $res_list[] = $tmp_img; | | | | | $res_list[] = $tmp_img; | | ||
- | | logic | for each in word_list: | foreach($word_list as $each){} | | + | | | for each in word_list: | foreach($word_list as $each){} | |
- | | | if mark == '#': | + | | | if id in check_list: | if(in_array($id, |
+ | | logic | if mark == '#': | ||
< | < | ||
Line 69: | Line 85: | ||
' | ' | ||
</ | </ | ||
+ | |||
+ | ====== Use PHP as HTML File output process ====== | ||
+ | |||
+ | * other than serve php page through apache server, php in commandline also can be used to create html local page. | ||
+ | * cmd code for render php to html file< | ||
+ | cd php_root_path | ||
+ | php.exe D: | ||
+ | </ | ||
+ |