php - Traverse $_POST Array to show field Names -
Is there an array, such as to see the name of $ _POST field and not just the value values Do something
foreach (as the $ _POST $ value) {echo $ value; } This will show me the value - but I would like to display the name in that array too. If my $ _POST value was something like $ _POST ['some'] and it was collected 55; I want to output "some".
I have a few selected fields for which I need it.
Do you mean it?
foreach ($ key as $ _POST = & gt; $ value) {resonant "$ key: $ value
"; } If you want an array of keys to repeat again, you can also use it.
If you want to use callback to repeat, you can also use it:
function test_walk (& $ value, $ key) {. .. do stuff ...} array_walk ($ arr, 'test_walk');
Comments
Post a Comment