Skip to content

Loop Through Nested JSON Response PHP

I’m trying to loop through and return data (‘rank’ from ‘rank_details’) from a returned JSON response. Here is a snippet of the JSON response (what I’m getting from: $array = json_decode($apiResponse);…

PHP for loop only works every second row

in my current project I want to split 10 users from a queue into 2 teams with 5 users each. When 10 users are in the queue the function create_new_lobby() is executed. In this function the match is …

Count number of columns in array php?

I have a simple function to count numbers of columns with specific value in the array: it works well while accept exists in the array. If not I get Undefined index: Accept. My array looks like that: How can I add something like isset here? Answer With oneliner is it not possible (or the code will be messy), s…

FPDF setting 2 consecutive values in one cell

I just need to find out how to set 2 values from MySQL database in a FPDF. The values will be consecutive with a ‘dash’ in between them. Here is an example of what I want to do. $pdf->Cell(110, 7,$…