I have to run some rather lengthy and legacy PHP scripts using cron. I want to capture the pid, output (both std and err) and log it to a file, but I would also like every line of this output to be …
Search an array for a key and output the value
I have a large array in PHP that has this snippet of data. Is there a way to search through an array and find the value of “date” without traversing through all the nodes? It should be noted that “date” in itself isn’t unique but $subscription->schedule_next_payment->date i…
Issue generating proper JSON array response
Essentially I have the following PHP script that generates a response based on output of the query, I need the JSON to in a different format with each response listed sequentially: <?php $stmt = $…
laravel 7 keeps adding ‘/public/’ to my api routes
I am trying to make a php curl request to my laravel api Here’s the curl function function CallAPI($method, $url, $data = false) { $curl = curl_init(); switch ($method) { case &…
how can I get the key and value from a multidimensional json response using php
Below is my code used to Get data from a REST API to retrieve States .The results contain the State code and State Name to be passed into a select option form with State code as Key and State name as value . My challenge is , i am unable to know the right way to access the data after
OneNote error creating a page in Laravel using Microsoft Graph
i’m using Microsoft Graph in my Laravel application. It works perfectly adding events to the user’s calendar, getting events, creating OneNote’s notebook. The problem occurs when i try to add a page, i’m getting the next error: The code i’m using is: The next code works fine: I c…
HTTP 413: Request too large
Using Apache 2.4 & PHP 7.4 on Ubuntu 18.04. Default Apache conf file. I’m trying to upload ~700 jpegs (totaling ~100MB, largest one being ~1MB) to a Laravel app, for a single one it works but for …
Xdebug 3 & PhpStorm 2020.2.4
I get this error when using Xdebug version 3 with PhpStorm version 2020.2.4 : Connection was not established. Cannot start debugger session with ‘Xdebug 3.0.0’ Validate installation php.ini Config: …
Laravel relation from a pivot
I have a relation that I cant figure out my current application looks like this Models Tables Now a tournament can have just some of the users participate in the tournament so I’ve created the below To store users that are participating in a tournament from the team. How should this look in terms of elo…
Accessing array value by direct passing value of another array in string
I tried to access the array value by passing the value of another array element in the string. Here is the example. It is giving me the error as syntax error, unexpected ‘[‘, expecting ‘]’ I tried to access the value out of the string like the following. It is working fine. Then I trie…