I have a curl that works fine. The file where the cURL is placed is a PHP file, executed by .ajax I am echoing an $apikey at the end of the PHP file, without the cURL script. it prints correctly. …
pg_insert(): Accepts only string key for values
I’ve got postgres table with an auto-incremental column, and attempting to insert data from PHP with pg_insert returns a string key error. How would I go about modifying this for the different datatypes? Currently returns the following error: A var_dump returns: My Postgres table is made up of: Answer From the PHP manual: pg_insert() inserts the values of assoc_array into
How to change dateformat on Yii platform?
I am new to the Yii platform, and I am wondering how to change the dateformat. It’s currently in the American date format that is YYYY-MM-DD. I want it to be DD-MM-YYYY. Is there any way to this? Answer config file add in ‘components’ => [] You can add it and edit it to your style.
Importing large number of pdfs into mPDF is causing /fopen to fail
Edit: Updated after assistance from Jan Edit: The code dos not fail until $mpdf->Output($max . ‘ imports .pdf’, ‘D’); is called PHP Version 7.1 MPDF Version 8.0.10 Setasign fpdi_pdf-parser Version 2.0.4 Error Failed to open file (fopen) Compnay Induction (checklist) th v2.pdf Failed to open file (fopen) Information Register for Employees.pdf Failed to open file (fopen) Coshh listings v7.pdf Failed
Simple array push in PHP exceeds allowed memory. (Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554440 bytes) )
This code is part of a bigger program but I identified this as the problem. I simply need to get the same values at the same indexes of arrays and this is the code I have written: and it gives me this error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554440 bytes) Adding more memory here is
PHP: Why does this return “undefined offset” every time?
So basically this is an algorithm I made for a battleships game. I’m having problems with the while loop, I want to have the code inside the do while loop keep repeating, if the generated values already exist in a multidimensional array, and it looks like it actually works, because it generates correct values, but I keep getting the error
PHP ForEach Array – display variables
I have a Curl query which outputs JSON as $response $response = curl_exec($curl); $response = json_decode($response, true); I have turned this into the below Array: Array ( [results] => Array …
PHP: Keep former included files when redirecting to sub level application page (index.php)
I restructed my website in a kind of modular way. For my self written web apps I have a sub folder structure. Now my central entry point on top level has routes to manage different URLs. The redirect …
Is there a difference between using use and passing the class path to a method?
In PHP there are two ways to use namespaced classes: Using an import (use) declaration: use TheClassNameSpaceMyClass; … public function myFunction(MyClass $myClass) { // Things to do } Using …
In PHP/ Mysql, how to access encrypted data in database after changing the salt value stored in a config file?
Currently I’m encrypting user sensitive data before storing it in the database: // salt retrieved from config file $salt = ‘a1b915580757c17c38a986faab21493d’; $sql = “insert into `appointments` …