<code><span>$configData</span>=<span>array</span>( <span>'1'</span>=><span>'11111111000111111'</span>, <span>'3'</span>=><span>'22222222000222222'</span>, <span>'4'</span>=><span>'33333333000333333'</span>, <span>'5'</span>=><span>'44444444000444444'</span>, <span>'6'</span>=><span>'55555555000555555'</span>, <span>'7'</span>=><span>'66666666000666666'</span>, <span>'7'</span>=><span>'77777777000777777'</span>, <span>'9'</span>=><span>'77777777000777777'</span>, ); <span>foreach</span>(<span>$configData</span><span>as</span><span>$key</span>=>&<span>$val</span>){ <span>$val</span>=str_replace(<span>'000'</span>,<span>'A'</span>,<span>$val</span>); <span>echo</span><span>$val</span>.<span>'<br>'</span>; } <span>echo</span><span>'<pre class="brush:php;toolbar:false">'; var_dump($configData);').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介绍了[php] 对数内的字符串用str_replace进行替换的技巧,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。