Latest article
How to do php query mysql garbled characters-PHP problem
The solution to php querying mysql garbled characters: 1. Modify the encoding type of the PHP page language itself; 2. Change the MySQL character set to “UTF8”; 3. Use the encoding conversion function in ultraplus to convert. Recommendation: “PHP Video Tutorial” The solution to garbled characters when PHP reads mysql Chinese data 1. The encoding type of the PHP page language itself is not suitable. At this time, the Chinese you write directly in the script must be garbled characters, not to mention the database. Solution: Select & # 39; UTF8 & # 39; Or ‘gb2312’, so that the client’s browser will automatically select and display the correct Chinese. Note: ‘UTF8’ or ‘gb2312’ can display Chinese correctly. 2. The encoding type in the database MySQL is incorrect. Solution: When creating a database, select ‘UTF8’ for the MySQL character set, and select utf8_general_ci for the MySQL connection proofreading. There must be no problem with the database created in this way to store Chinese. Otherwise, your Chinese will be garbled characters in MySQL first, and don’t expect it to display correctly in the PHP page for you. 3. It is related to the usual script editing environment. For example, some content is…
How does php implement form submission without refreshing – PHP problem
How to implement form submission without refresh in php: first add “target=”id_iframe”” to the form form; then add code “ The above is how PHP implements form submission without refresh For more details, please pay attention to other related articles on 1024programmer.com!
How does php remove the last few characters-PHP problem
How to remove the last few characters in php: first create a PHP sample file; then define a string; finally use the “substr($str,0,-4);” method to remove the last specified character. Recommendation: “PHP Video Tutorial” <? php $str='programming'; //Define a string $res=substr($str,-4); //Process string echo "Return the last 4 characters {$res} of {$str} string"; $res=substr($str,0,-4); //Process string echo "Return to the {$str} string to remove the last 4 characters{$res}”;?> The above is the detailed content of how PHP removes the last few characters, and more Please pay more attention to other related articles on 1024programmer.com!