php - Using str_replace for digit when grater than ten -


this question has answer here:

here code-

$input=10; $number = array('0','1','2','3','4','5','6','7','8','9','10'); $text = array('a','b','c','d','e','f','g','h','i','j','k'); $print = str_replace($number, $text, $input); 

what i'm expecting replace '10' 'k'. replacing 10 'ba' how use str_replace in above condition?

$input=10; $number = array('10','0','1','2','3','4','5','6','7','8','9'); $text = array('k','a','b','c','d','e','f','g','h','i','j'); $print = str_replace($number, $text, $input); 

it's enough put '10' , 'k' @ begin, first replace string , not other.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -