日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php str_replace多个参数,php str_replace()函数的用法,有那些参数?

發布時間:2024/1/23 php 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php str_replace多个参数,php str_replace()函数的用法,有那些参数? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

范例

例 2329. str_replace() examples

// Provides:

$bodytag = str_replace("%body%", "black", "

");

// Provides: Hll Wrld f PHP

$vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U");

$onlyconsonants = str_replace($vowels, "", "Hello World of PHP");

// Provides: 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);

// Use of the count parameter is available as of PHP 5.0.0

$str = str_replace("ll", "", "good golly miss molly!", $count);

echo $count; // 2

// Order of replacement

$str = "Line 1\nLine 2\rLine 3\r\nLine 4\n";

$order = array("\r\n", "\n", "\r");

$replace = '
';

// Processes \r\n's first so they aren't converted twice.

$newstr = str_replace($order, $replace, $str);

// Outputs: apearpearle pear

$letters = array('a', 'p');

$fruit = array('apple', 'pear');

$text = 'a p';

$output = str_replace($letters, $fruit, $text);

echo $output;

?>

總結

以上是生活随笔為你收集整理的php str_replace多个参数,php str_replace()函数的用法,有那些参数?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。