I’m trying to move an application to PHP 8 from PHP 7. But whenever there’s an error in my code, only the first error is displayed, even if there’s a fatal error after that first error. error_reporting is set to E_ALL, display_errors and display_startup_errors are on. For example, Only the e…
Tag: php
How to crawl page in PHP?
I get the error: “error code: 1020″. The page I’m trying to crawl for form data is: https://v2.gcchmc.org/medical-status-search/. This is my code: $initial = file_get_contents(‘https://v2.gcchmc.org/medical-status-search/’); $check = preg_replace(‘/.+?input type=”hidd…
Is there a method in PHP to use a varible as all or part of a classname?
Example The goal is to have a dynamic variable which changes the appended string based on folder names found in a directory. Answer It is possible to use PHP to write a file that contains a class definition and then include or require that file. The newly created class could have a name based on a variable. S…
PHP / Javascript AES 128 CFB Encryption / Decryption CryptoJS OpenSSL
Working Decryption in PHP Will output “Decrypted Message” I’m trying to replicate it in Javascript I get an empty response, any help would be appreciated as to where I’ve gone wrong. Thanks Answer CFB is a stream cipher mode, i.e. does not use padding. In a mode with padding, the ciphe…
PHP MySQL Selecting Multiple Tables Based on Column/Row Value
I am just doing some testing with a few tables that I’m trying to relate together, based on the values of my ‘students’ table. Here are the total tables that I have: students TABLE id, name, course_num, msg_num biology TABLE id, details, msg_num chemistry TABLE id, details, msg_num physics T…
Group and sort multiple associative arrays in PHP based on two conditions
I have couple of associative arrays like this I want to get the arrays that have the latest hired year, and also based on the department order. so the department priorities are [‘math’, ‘science’, ‘social’] (ordered based on priority) If only one array has recent years: For…
Performance when shipping logs from PHP to AWS ElasticSearch/OpenSearch
Is it recommended to ship logs directly from a PHP app to ElasticSearch? Or is it always better to store to file and use filebeat to ship the logs? I’m familiar with C# and Serilog implementation sending directly to ES and we’ve never had an issue with it, but was wondering if the same could be do…
Error: Expected Literal, got ‘*’ in Doctrine
I want to retrieve the number of rows in my courrier table. In my fixtures, I have these lines : I have these mistakes when I do symfony console doctrine:fixtures:load : What’s wrong with the * in my query ? Answer Doctrine expects you to use one of the fields of your entity. In SQL you don’t need…
Laravel (How do I add data to database)
Here’s my code that shows projects assigned to a user. HomeController home.blade.php ProjectController that show issues within the project. route: issues.blade.php I made a button in the issues page that shows a modal that has a form for adding issues for the selected project. Can you help me with this?…
zip file made by php shows wrong folder structure in js-dos but correct in windows
I am working on a project which requires me to collect several files from the server, zip them, and mount the zip as a drive with js-dos. Everything works ‘correctly’. During testing I manually made a zip file in windows and the code ran. For the final test I tried to mount the php generated zip b…