Tag: FORMAT
-
Post Views: 17 1. Request parameters in the interface 2. The final implementation of the Rules in the model is as follows 3. However, the value of the last write to mysql is 2025-04-05 07:59:59 4. yii::$app->formatter is a tool for display, not designed for the format of data storage. Decide to splicing directly, and finally achieve the following 5.…
-
Post Views: 54 1. When requesting the WeChat Mini Program interface: obtaining unrestricted applet code, an error is reported: errcode: 47001, errmsg: data format error Rid. as shown in Figure 1 2. Adjust the content-type of the request parameter and solve it. Then another error is reported: errcode: 41030, errmsg: invalid page Rid. as shown in Figure 2 3. Adjust…
-
Post Views: 17 1. The code is implemented as follows 2. But the verification failed, as shown in Figure 1 3. Since the format of H:I is the format in PHP. Set the string starting with php: to represent the date-time format that PHP can recognize. Verification passed. as shown in Figure 2
-
Post Views: 17 1. In PHP, replace some sensitive characters in a string based on preg_replace. One problem that exists is that in its format, a certain string may not exist. Example as follows 2. Why exist the above 3 formats, the reason is that it is generated based on the following code 3. The final code is as follows…
-
Post Views: 18 1. The existing time field, its value is: 20231020105244000+0800, it can be known that its format in PHP is: ymdhisvo. Reference:https://www.php.net/manual/zh/datetime.format.php 2. Based on DateTime::CreateFromFormat — date_create_from_format – parse the time string according to the specified format. Print the returned DateTime object. as shown in Figure 1 3. Based on DateTimeInterface::Format — DateTimeImmutable::Format — DateTime::Format — Date_Format…
-
Post Views: 18 1. When starting Vagrant, an error is reported: D:/Program files/hashicorp/vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse: (): found a tab character that violates indentation while scanning a plain scalar at line 10 Column 7 (psych::SyntaxError). as shown in Figure 1 2. View the file ~/homestead/homestead.yaml in phpstorm, and find a red wavy line prompt. The reason may be that it has been…
-
Post Views: 17 1. The error is reported when uploading the picture file, because the picture in GIF format is uploaded, which is treated as a JPEG format. as shown in Figure 1 2. Check the corresponding code implementation. 3. Decide to judge the extension of the file after receiving the request. Reference URL:https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/HttpFoundation/File/UploadedFile.php. Returns the original file extension. How…
-
Post Views: 19 1. A JSON structured and escaped character. as shown in Figure 1 2. I want to format the value of the result field in JSON. Open URL:https://www.bejson.com/. Copy the content to the online tool, then click Remove Escape. as shown in Figure 2 Before escaping: After escaping: 3. After removing the escape, click Format Check to get…