久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何替換數(shù)組里的字符串

      php替換數(shù)組里的字符串的方法:可以利用str_replace函數(shù)來進(jìn)行替換,如【str_replace("red","pink",$arr,$i)】。如果搜索的字符串是一個(gè)數(shù)組,那么它將對(duì)數(shù)組中的每個(gè)元素進(jìn)行查找和替換。

      php如何替換數(shù)組里的字符串

      本文操作環(huán)境:windows10系統(tǒng)、php 7.3、thinkpad t480電腦。

      如果我們需要替換數(shù)組中的字符串,可以利用str_replace()函數(shù)。

      提示:如果搜索的字符串是一個(gè)數(shù)組,那么它將對(duì)數(shù)組中的每個(gè)元素進(jìn)行查找和替換。

      語法:

      str_replace(find,replace,string,count)

      參數(shù)介紹:

      • find 必需。規(guī)定要查找的值。

      • replace 必需。規(guī)定替換 find 中的值的值。

      • string 必需。規(guī)定被搜索的字符串。

      • count 可選。一個(gè)變量,對(duì)替換數(shù)進(jìn)行計(jì)數(shù)。

      代碼示例:

      <!DOCTYPE html> <html> <body>  <?php $arr = array("blue","red","green","yellow"); print_r(str_replace("red","pink",$arr,$i)); echo "<br>" . "Replacements: $i"; ?>  <p>In this example, we search an array to find the value "red", and then we replace the value "red" with "pink".</p>  </body> </html>

      (學(xué)習(xí)視頻分享:php視頻教程)

      運(yùn)行結(jié)果:

      php如何替換數(shù)組里的字符串

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)