Category: PHP 7.4
-
Post Views: 17 1. In Laravel 6, ThemeInstallation::IscodeEdited must return a relationship instance.. as shown in Figure 1 2. View the method in the model file 3. Finally found the reason, $theme->ThemeInstallation->iscodeEdited needs to add ()
-
Post Views: 19 1. In PHP 7.4, when using file_put_contents, an error is reported: Failed to open stream: no such file or directory. as shown in Figure 1 2. The reason is the file name: theme-cdn-config-2023-02-23-10:23:19.txt format is incorrect, it contains :, replace : with -, run again, no errors are reported.
-
Post Views: 20 1. In the container, when the environment variable is obtained for the first time, the configuration value of the production environment is obtained, or it is not obtained (set in the program, when the environment variable is not set, the default setting is the configuration value of the production environment). When the environment variable is obtained for…
-
Post Views: 13 1. Now there is a string with the following contents 2. It is expected to batch replace the default in the string to basic 3. Refer to the str::replaceArray function to replace the given value in the string using the array order 4. Since there is only one element in the array $replace, only one default is…
-
Post Views: 16 1. Report an error in PHP 7.4: Cannot RedeClare GetFirstSkuIndex(). Indicates that the function getFirstSkuIndex() has been defined. PHP does not support redefining declared functions. as shown in Figure 1 2. Reference:https://www.shuijingwanwq.com/2022/11/14/7149/, now because the same file is repeatedly introduced (re-introduced on business). This leads to the same function being duplicated. 3. View the code implementation of…
-
Post Views: 19 1. Error in PHP 7.4: Array to String Conversion. as shown in Figure 1 2. Check the second line of the error file, the code is as follows. as shown in Figure 2 3. Decide to debug online, and decide to print this variable according to the array format 4. When echo, its parameters are cast to…
-
Post Views: 17 1. Reference:https://www.shuijingwanwq.com/2022/11/02/7121/. Now, due to the existence of some special version numbers, it does not meet the specification of semantic 2.0. The final requirements are as follows: v2.0.0 < v2.0.0-h.1 2. Implement v2.0.0 < v2.0.0-h.1, after executing version_compare, the result is: bool(false), that is, v2.0.0 is not less than v2.0.0-h.1. 3. The existing code is implemented as…