Skip to content

Tag: php

Load the PHP contents only after switching a nav tab

I have 10 tabs on my project, each of them will fetch some values from API using PHP. It takes 10-15 seconds to load the page every time (since it updates the values for all 10 Tabs) How do i load content only after switching a tab? Load TAB1 at start, then only after clicking TAB2 or TAB3 then load

Decimal are converted to String in Laravel, cast is not working

I have a problem changing data type column in my table, from double to decimal each (6,2). Olso trying to $cast the variable to float, I’ve tried to cast olso as decimal, but nothing change, nothing change: if I dd $this in my resource I got this: The data back to be a number only if I rollback the data

Call an existing php variable by concatenating two strings

I have these seven php variables: I would like to loop through the results array and pass the corresponding variables to a function. I cannot figure out how to declare the variables. Or if this is even possible. I have more than just $data and $target variables, but I simplified down to two for the question. …

Laravel route setting incorret and search function issues

This function search user from MySQL. Can anyone knows which part I did wrong ?, searchUser function is not triggered. admin view Answer You can remove type=”button” from below line or change type=”submit” If still that not works for you then you should defile action=”{{ route(&#…

Form an array list in the another format using PHP

I have an associate array format like $aa. Need to form an array list in the different format. Have to form the array like the below format in PHP. Help me on this. Thanks in advance Answer array_map() takes an arbitrary number of arrays as arguments(it can do more than the “standard case” with on…

Change value of returned PDOStatement [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question I have a function getMaxID, which queries a database (messages) and gets the maximum id I …