I have a multi-dimensional array:
array(3) {
[0]=> array(2) {
[0]=> string(3) "ABC"
[1]=> string(3) "744"
}
[1]=> array(2) {
[0]=> string(3) "DEF"
[1]=> string(2) "86"
}
[2]=> array(2) {
[0]=> string(3) "GHI"
[1]=> string(1) "2"
}
}
Now I want to convert the string-type values which are numbers to integer type.
Ex 744
is string but it should be integer.
I have tried a few functions after searching forums but with no success.
Later I have to use this array in json_encode()
function and in my javascript process numeric values must be integer-type.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…