Skip to content

merge two equal structural multi-arrays with different data

i can’t believe that i can’t find a solution to this seemingly simple problem, and i tried everything. i have two multi arrays: the first one: the second one has the exact same structure, but with new data: what i need mergin both multi-arrays is this result: but i can’t get this result with…

I need to check if time now is between two times

I need to check IF time is between two times with PHP I tried a lot of examples but they are not working for me, I guess I’m asking a stupid question but I’m not finding any answer. I need to check IF current time is between $datetime1 and $datetime2. IF is between { do something } ELSE { do

I want the minimum to be 0 but the substraction is still negative

I’m beggining in OOP with PHP, and i want to make 2 opponent fight, with the function fight. I want to have a $degat variable which is a result of a radom number between 1 to strength of attacker – (minus) dexterity of defender. So the result must be of minimum 0. I have this code and when I var_d…

How to get word after user input in textarea?

I have a text area to user to insert text, but if the user type {{name}}, {{nickname}} and {{email}}. It must show the message with that value. Let me demonstrate: For example: If user type: Hello, {{name}} has {{nickname}} and {{email}} the message must be like this: Hello, user A has nickname A and email@gm…

Best way to run a SQL query for different dates

I have a PHP application that records the sessions of various devices connected to a server. The database has a table session, with the columns device_id, start_date, end_date. To know the number of devices connected on a given date, I can use the request : where :date is passed as a parameter to the prepared…