Skip to content
Advertisement

Tag: arrays

replace all keys in php array

This is my array: how can I replace all the “e” letters with “!” in the key name and keep the values so that I will get something like that I found this but because I don’t have the same name for all keys I can’t use It Answer I hope your array looks like this:- If yes then you

How do I output in proper JSON format in PHP?

I want to output some records from mysql table with resCode and resText in JSON in the following way: Since I’m very new to PHP arrays, I’m unable to format the server side part to output like above. Also I don’t know how to output the resCode and resText. Any help for the same will be appreciated. PHP part: Answer

Text File to Array

I am trying to put my text file into an array.. my text file content is like this: anyone can help me to make the output looks like this: thanks in advance.. this is my code:- the problem is it outputs a multidimensional without array names.. and i am not familiar in multidimensional array.. Answer You can do something like

Advertisement