Skip to content
Advertisement

Tag: php-7

PHP looping over data and getting key/value pairs

I’m using Laravel 8 to loop over some data. I’ve got my data out from my database, but am struggling to loop over the data in a foreach loop, it doesn’t appear to be giving me the key/value pairs, only the index/value pair? But if I var_dump() my $applicationOptions I can see the array inside of the attributes and the

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

DCoder and php include files on Android

I’ve downloaded the DCoder app for Android on Google play hoping to code some php code on Android. However, I’ve created two php files in the top level directory and included one from the other with require_once. The result was that DCoder couldn’t find the other file. Is it possible to include files with DCoder in PHP? Thanks. Answer With

How to specify the void return type for a constructor

For consistency I’m specifying return types since PHP 7.1, for all methods, including magic ones like __toString, and even when the implicit return type is void like with __unserialize(): When I try the same for constructors and destructors, like this: PHP yields Fatal errors: The only thing I can do right now is to specify the implicit return type in

Advertisement