Skip to content

Get an array in a php file from http request

I’m learning php and I’m trying to get a php file from a http request using Guzzle and then just take a particular array from those contents and ignore the rest. But I’m unsure how to get that array. When I print $contents it looks as expected, for example: I want to just get the array, iter…

Laravel 7 – paginate sorted by DESC

I’m trying to display posts from the database, but i want to have the latest on top. This means I have to do this inside of my HomeController.php: But when the site grows up, it might be complicated to find the particular post, so I decided to implement pagination. Unfortunately, pagination only works w…

Can’t include js files in php file on cpanel

I am trying to use a JavaScript library (from GitHub) on my website but I can’t get it to work. It works when I set it up in VS code but not when I upload my code to cpanel (along with the required files). The website is a wordpress site so I just create page templates and link the templates

Email body content translation issue in laravel

hello all in my laravel app I have language translation option. English and French. So In my lang folder I have en and fr folders. Each folder I have a file called, sentence.php where I store my …

Developing a Reward Box Algorithm [closed]

I’m trying to build a probability algorithm that will give the user his/her reward based on these probabilities. 1 $ – 60% 2 $ – 25% 5 $ – 12% 10 $ – 1.99% 50 $ – 1% 500 $ – 0.01% How can I do that? …

JQuery update select option

Need a little help on this one. I am trying to write jQuery code to change the selection of a select dropdown. Following the excellent advice on here, I am using .val(). However, this doesn’t remove …

Parsing nested json data to extract a certain value

so I have a nested JSON response form a JSON request I’m having trouble parsing the nested JSON data to get a certain value I have commented out on the data in need ( “link”: “http://i.imgur.com/DnjD527h.gif”) need to extract data in two places see the JSON data for comments. Sin…