devwiki:php

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devwiki:php [2021/12/23 08:46] – [Python to Php] yingdevwiki: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);
 +</code>
 +
 +  * unicode data insert, make sure
 +    - database table's charset is utf8mb4 in sql<code>
 +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;
 +</code>
 +    - make sure database connect is set to utf8mb4 mode in php before query and insert<code>
 +mysqli_set_charset($con, "utf8mb4");
 +</code>
 +    - make sure charset is declared in html <code>
 +<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 </code> </code>
 ====== Php Date and Time Related ====== ====== Php Date and Time Related ======
Line 70: Line 85:
 '\n'.join(res_list) '\n'.join(res_list)
 </code> </code>
 +
 +====== 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<code>
 +cd php_root_path
 +php.exe D:\path_to_php_web_page\test.php D:\path_to_php_web_page\test_out.html
 +</code>
 +
  • devwiki/php.txt
  • Last modified: 2022/11/16 16:16
  • by ying