Category: PHP
-
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…
-
Post Views: 19 1. Reference: In Linux and Laravel 6, the task queue is always running for troubleshooting and analysis (timeout time has been set):https://www.shuijingwanwq.com/2022/11/10/7139/. The previous reason was that the command line did not return 1 when Artisan::Call was executed, which caused the judgment to be invalid. 2. But after the solution, the task queue has been running again…
-
Post Views: 21 1. Existing code implementation 2. The final generated structure is as follows, which is an array with the field name: SETTING_MIGRATIONS 3. Decide to adjust the name of the adjustment field as extra, and include the value of the setting_migrations field. The code is adjusted as follows, based on the helper function ar. 4. The final generated…
-
Post Views: 15 1. The existing PHP code is implemented as follows 2. Open:https://regex101.com/, the matching is successful, and the result is as follows. as shown in Figure 1 3. Now expect that internal://all_collections/ can also match. Tip: Your regex doesn’t match the theme string. as shown in Figure 2 4. Characters with special meanings in regular expressions are called…
-
Post Views: 19 1. The code is as follows, set the value in the json field of mysql, and report an error: unsupported opera and types . as shown in Figure 1 2. The adjustment code is as follows 3. Implement a new JSON to the field when there is a value in the JSON field. The structure of the…
-
Post Views: 16 1. The list of catalogs at this stage is as follows: v2.0.15-rc.6, v2.0.15-rc.7, v2.0.15, v2.0.16- hotfix.2, v2.0.16-hotfix.3, v2.0.16, v2.0.17-rc.0, v2.0.20. as shown in Figure 1 2. Get all the subdirectories of the given directory and use glob() with the glob_onlydir option. 3. The printing results are as follows, in line with expectations. as shown in Figure 2…
-
Post Views: 15 1. Navigate to the directory where you want to create the application (e:\wwwroot\shopify-app). Your application will be created in a new subdirectory. as shown in Figure 1 2. Run one of the following commands to create a new application, and then select the language of the application template you want to start using: Node, PHP, or Ruby.…
-
Post Views: 20 1. Error: count(): parameter must be an array or an object that implements countable (view: ). as shown in Figure 1 2. Check the code implementation 3. Print $user->address_book, its value is null 4. Adjust the code implementation, when $user->address_book is null, the expression $user->address_book ??[]equivalent to[], otherwise it is $user->address_book. 5. In PHP 7.2.0, when the…
-
Post Views: 16 1. A GraphQL API, which takes up to 7 seconds. as shown in Figure 1 2. The time to query this request in Laravel Telescope, 1345 ms. as shown in Figure 2 3. Instead of requesting the GraphQL API on the page, it takes 1.87 seconds to request a separate request using the Altair GraphQL Client. Approximately…