This article mainly share with you the PHP region time selection and settings, PHP default time is the European GMT Time (Europe/berlin), exactly 8 hours.
Processing method:
1. Find the time to initialize the seat, plus, such as:
Date_default_timezone_set ("PRC"); echo "Time:". Date ("Y-m-d h:i:s", Time ());
Encountered a good PHP code. Record it.When you write PHP code, you often encounter the need to return the value of the situation, you can set the return value of the uniform format. Here's a good example.Configuration Class Return.conf.php1PHP2 define ("Return_val", "Return Array" (' Code ' = 0, ' msg ' = ' = ', ' data ' = '); ");3 4 Define("Return_success", 0); 5 Define("Return_runtime_err", 1); 6 Define(
For php database connection encoding settings, I first run the PHP website locally. The environment has been properly matched and the database has been imported. an error occurs during IIS browsing. a prompt box is displayed, ". $ str."
This is the error. Is there any help.
Public function show_error ($ message = '', $ SQL = ''){
Echo"
";
Echo"
Error mes
implementOverride x-powered-by:php:Header (' x-powered-by:php/4.4.0 ');Header (' x-powered-by:brain/0.6b ');Document languageHeader (' content-language:en ');Tell the browser when it was last modified$time = time ()-60; or Filemtime ($FN), etcHeader (' last-modified: '. Gmdate (' d, D M Y h:i:s ', $time). ' GMT ');Tell the browser that the contents of the document have not changedHeader (' http/1.1 304 not Modified ');Set Content lengthHeader (' content-length:1234 ');Set as a download typeHead
PHP gives different error hints for different severity errors at run time.Development, in order to standardize the program, the error level to higher, notice level of the report, to help quickly locate errors and code specifications. In the product line, the site operation process, it is not appropriate to report so many wrong, 1: This error to the customer's impression is not good; 2: in error, the absolute path of the website is reported, increase t
This warning is sometimes present in writing PHP programs:
PHP warning:date (): It isn't safe to rely on the system's timezone settings. You are are *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you are used any of those methods and your are still getting this warning, for you most likely misspelled the timezon
Add the temperature Celsius (℃) field to the PHP database what type is displayed on the page = what settings are required
PHP adds a field of temperature Celsius to a database table what type of field is required to display ℃ (such as -1℃~8℃) on the page?
------Solution--------------------
Can't you do the characters?
This article mainly introduces the common http header settings of the phpheader function. This article provides code examples. The Code contains detailed comments. For more information, see
// Okheader ('HTTP/1.1 200 OK '); // set a 404 header: header ('HTTP/1.1 404 Not Found '); // set the address to be Permanently redirected header ('HTTP/1.1 301 Moved Permanently '); // go to a new address header ('location: http://www.example.org /'); // file dela
following area of the function call in the current script error_reporting() .int error_reporting ([ int $level ] )The parameter can be an integer or a corresponding constant identifier, and it is recommended to use the form of a constant. The return value is the value of the error report level at the current position (integer value).Some error reporting levels are listed below:值 常量 说明1 E_ERROR 报告导致脚本终止运行的致命错误2 E_WARNING 报告运行
Label:A lot of people are writing MySQL and mysqli sentence is easy to cause Chinese garbled! Mysqli because the default is LATIN-1 encoding, when your page Utf-8 encoding is, will produce the page garbled problem. Mysqli garbled Solution: $mysqli = new mysqli (' localhost ', ' root ', ' password ', ' dbname '),//mysqli link database notation//$mysqli->query (" Set NAMES UTF8 ");//Write a $mysqli _query ($db," SET NAMES UTF8 ");//The two above methods
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.