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 &…
Tag: php
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 …
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…
Getting live feed in Google charts
Rooky in need for some help here! I am trying to set up Google chart connected to a database that will be populated during the whole day. So this chart needs to have a live feed. I got below scrip and query. The Query works, and gives the feedback I need. Assuming that some magic in the ‘var data’…
I am getting Warning:count():Parameter error
I am getting this error below in my vehicles-update.php and I have also attached my vehicle/index.PHP code. It appears before my header on my phpmotors/index.php page. Warning: count(): Parameter must be an array or an object that implements Countable in C:xammp_124htdocsphpmotorsvehiclesindex.php on line 142…
How to call variable inside function while using require or include outside that function in php
So, can we call a variable inside function using require or include without using it in the function? This is the example code: Include / Require file (let’s say the file is “include.php”) Index file Expected output : Some Value Another Value Answer The use of include/require is actually not…
Newbie question: Static countdown timer based on server time
A client wants a launch page which will show a static countdown and when the countdown is finished the user will be redirected to another page. The launch is like an event for all users, so I want to make it hard for the user to access the redirected page before the countdown reaches zero – therefore I …