Skip to content
Advertisement

Tag: key-value

Getting value of clicked element in PHP

I have a page with element <a> acting like a <button>, in this form the elements works like a service plans, and i want to get a value when one of these buttons has been clicked. Page1.php Page2.php I know that $_POST[‘name’] doesn’t works cuz don’t exist a input, but i don’t know how use something like this to get

PHP rename the keys of an array

How can I rename keys in an array? Start with this array named $start_array, and change the keys for ‘date’ and ‘revenue’ so you get this $final_array: Here is my terrible attempt which works but is messy. Answer Try the above code.

Advertisement