[php] Tips on using str_replace to replace strings in logarithms

WBOY
Release: 2016-07-29 09:03:10
Original
1457 people have browsed it

<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">'</span>;
var_dump(<span>$configData</span>);</code>
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces [php] the technique of using str_replace to replace strings in logarithms, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template