PHP JSON display number if digits in foreach loop

i have a question and i need help with my json and php. I use foreach loop to get the object number from my json. And when i get data from mark of mastery it displays like 13423452623423 i want to display it as 14 not 13423452623423. I just want to display how many number of digits but how do i do that? Thank you. (Sorry for my bad english)

You can output the length of a string using strlen. If your data is coming in as an int, you can cast that to a string before using strlen. So assuming that echo $tank_id['mark_of_mastery'] is displaying 13423452623423, then you would use: