久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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 反斜杠如何替換掉?

      PHP 反斜杠如何替換掉?

      PHP 反斜杠如何替換掉?

      在php中可以使用“str_replace()”函數(shù)將反斜杠替換掉,該函數(shù)用于替換字符串中的一些字符,使用方法:將反斜杠傳入第1個參數(shù),第2個參數(shù)留空,第3個為被替換的字符串,最后接收返回值即可。

      語法

      str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] ) : mixed

      參數(shù)

      如果 search 和 replace 都是數(shù)組,它們的值將會被依次處理。

      search

      查找的目標(biāo)值,也就是 needle。一個數(shù)組可以指定多個目標(biāo)。

      replace

      search 的替換值。一個數(shù)組可以被用來指定多重替換。

      subject

      執(zhí)行替換的數(shù)組或者字符串。也就是 haystack。

      如果 subject 是一個數(shù)組,替換操作將遍歷整個 subject,返回值也將是一個數(shù)組。

      count

      如果被指定,它的值將被設(shè)置為替換發(fā)生的次數(shù)。

      示例

      <?php // 賦值: <body text='black'> $bodytag = str_replace("%body%", "black", "<body text='%body%'>");  // 賦值: Hll Wrld f PHP $vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U"); $onlyconsonants = str_replace($vowels, "", "Hello World of PHP");  // 賦值: You should eat pizza, beer, and ice cream every day $phrase  = "You should eat fruits, vegetables, and fiber every day."; $healthy = array("fruits", "vegetables", "fiber"); $yummy   = array("pizza", "beer", "ice cream");  $newphrase = str_replace($healthy, $yummy, $phrase);  // 賦值: 2 $str = str_replace("ll", "", "good golly miss molly!", $count); echo $count; ?>

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