substr php,PHP substr() 函数
更多實(shí)例
例子 1
使用帶有不同正負(fù)數(shù)的 start 參數(shù):<?phpecho substr("Hello world",10)."
";echo substr("Hello world",1)."
";echo substr("Hello world",3)."
";echo substr("Hello world",7)."
";echo substr("Hello world",-1)."
";echo substr("Hello world",-10)."
";echo substr("Hello world",-8)."
";echo substr("Hello world",-4)."
";?>
例子 2
使用帶有不同正負(fù)數(shù)的 start 和 length 參數(shù):<?phpecho substr("Hello world",0,10)."
";echo substr("Hello world",1,8)."
";echo substr("Hello world",0,5)."
";echo substr("Hello world",6,6)."
";echo substr("Hello world",0,-1)."
";echo substr("Hello world",-10,-2)."
";echo substr("Hello world",0,-6)."
";echo substr("Hello world",-2-3)."
";?>
總結(jié)
以上是生活随笔為你收集整理的substr php,PHP substr() 函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言改错和填空能运行吗,C语言改错填空
- 下一篇: java代码块是对象吗_面向对象(Jav