Skip to content

Tag: php-7

Line up two tables

I have two following arrays: Now I want to take the common part of them, based on the date value, starting from the top and bottom, so the result should look like this: I have started with something like this: But it does not work, if there is a difference in the middle, how can I repair this? Answer Get

How to create recursive array from the loop PHP? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. Improve this question I have an array like below and its dynamic array. I want to create an another array recursively using the above

Install php-opcache for PHP installed via Remi’s repository

I have an environment with the following setup: Centos/RHEL 8 PHP 7.4 installed from Remi’s repository I have set installed php like so: Now I want to install php-opcache. However dnf is reporting that there doesn’t appear to be a module php74-php-opcache. I’m fairly convinced this has something to do with how repos are set up, as on my dev

Migrate to PHP 8.0: Unbinding $this when $this is used

Step by step, I am migrating my project(s) from PHP 7.1 to PHP 8.0. In the official PHP manual, in the subchapter “Deprecated Features” of the chapter “Migrating from PHP 7.3.x to PHP 7.4.x”, I tried to understand the following deprecation description: Unbinding $this when $this is used Unbinding $this of a non-static closure that uses $this is deprecated. Though,

Quickest way to get Expression Engine v 2.5.5 working with PHP7

A client’s host has recently updated their server to run PHP 7, which has broken their EE 2.5.5. site (“Call to undefined function mysql_connect()”). I tried upgrading EE to version 2.11.9 but get errors: Frontend: can’t find safecracker_lib Control Panel: PATH_MOD not defined in mod_structure.php, fixing this leads down a rabbit hole starting with an error related to not being

refactor IF statement with multiple returns

I have a code similar to this: it is honestly not so looking good but I need to check the variables to respect some sort of priority order. I was guessing if there is a better way to write this? Answer You can use a switch / case where the condition is TRUE. Example: Further Reading:

composer require phpoffice/phpspreadsheet don’t work

initially, I needed a library that will help me upload data to Excel, found this library and then there was a problem i try to install composer require phpoffice/phpspreadsheet but i have problem I don’t understand where the error comes from, because there is a dependency “ext-spltype”: “*” in my composer.json this is my composer.json i also try to install