只是看着功能如何在另一個字符串中插入字符串?
str_pad($input, $pad_length, $pad_str, [STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH])
這有助於墊在左,右或在一個給定的輸入兩岸部分字符串。
是否有任何PHP函數可用於在輸入字符串中插入字符串?
例如..
$input = "abcdef";
$pad_str = "@";
所以如果我給插入索引3,它插入"@"
後前3個最左邊的字符和$input
變得"[email protected]"
。
感謝
substr_replace(「123123123」,「@」,3,0)是「123 @ 123123」 – 2009-09-03 11:07:54
這是什麼OP問:-) – 2009-09-03 11:10:48
是這是我想看的功能..謝謝。 – TigerTiger 2009-09-03 11:31:06