Tag: PHP 7.4
-
Post Views: 24 1. Due to the front-end, the same page, for mobile devices and desktop devices, is a separate page. Therefore, you need to detect whether it is a mobile device in PHP 7.4, which in turn renders different template files 2. Reference:mobile-detect . Only the latest version of 3.* can be used, because PHP 7.4 is now used,…
-
Post Views: 15 1. Now you need to take the URI format data from a one-dimensional array. The print result of a one-dimensional array, as shown in Figure 1 2. The implementation is as follows based on the filter_var code, and the printing result is as follows, which does not meet the expectations, which exists: internal://policy_pages/29 3. Obtain the scheme…
-
Post Views: 18 1. Add elements to a specific position in the index array, and now plan to add 2 elements, after price. 2. Based on array_splice — remove a part of the array and replace it with other values, the code is implemented as follows, 3. Print the running results, in line with expectations. as shown in Figure 1…
-
Post Views: 27 1. Error in PHP 7.4: ErrorException array_key_exists() expects parameter 2 to be array, int give. as shown in Figure 1 2. The code is implemented as follows, the reason is that require($this->getCachePath()) returns 1, and the root of the return 1 is the path $this->getCachePath() The content in the represented file is empty. 3. In fact, when…
-
Post Views: 19 1. FilemTime(): stat failed for /var/www/object/storage/app/theme_downloads/2023/07/19/16 89733510.7774.265283535/migrations/migrate_cart.blade.php . as shown in Figure 1 2. The code is implemented as follows 3. Try setting $PATH to a file path that does not exist. Test in the local environment. Error: warning: filemTime(): stat failed for somefile.txt in e:\wwwroot\phpinfo.php on line 7. Therefore, it is necessary to ensure that the…
-
Post Views: 18 1. When executing array_diff in PHP 7.4 — when calculating the difference set of the array, an error is reported: Object of class theme version could not be converted to string. as shown in Figure 1 2. The code is implemented as follows, and print the two arrays of comparisons respectively 3. Adjust to array_udiff — Use…
-
Post Views: 19 1. Reference:In PHP 7.4, the script files in the directory are executed one by one based on the directory name of the semantic version 2. Now there is a need to no longer use semantic versions as directory names. When the directory name is out of control, the directory list may appear as follows: CUSTOM_MOBILE_LAYOUT_2 , p333,…
-
Post Views: 18 1. Report an error in PHP 7.4: mkdir(): file exists. as shown in Figure 1 2. However, in the code implementation, it is first judged that the directory does not exist before executing mkdir(). But at the time of execution, the directory already exists. It should be a problem caused by request concurrency. 3. Reproduce this error…