php substr函数的用法6,PHP中substr函数如何使用?
PHP中substr函數(shù)如何使用?,字符串,參數(shù),示例,語法,函數(shù)
PHP中substr函數(shù)如何使用?
易采站長站,站長之家為您整理了PHP中substr函數(shù)如何使用?的相關(guān)內(nèi)容。
PHP中substr函數(shù)的作用是返回字符串的一部分,其語法為“substr(string,start,length)”,其參數(shù)string表示返回其中一部分的字符串,參數(shù)start表示在字符串的何處開始,參數(shù)length表示截取長度。
使用示例<?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)."
";?><?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)."
";?>以上就是關(guān)于對PHP中substr函數(shù)如何使用?的詳細(xì)介紹。歡迎大家對PHP中substr函數(shù)如何使用?內(nèi)容提出寶貴意見
總結(jié)
以上是生活随笔為你收集整理的php substr函数的用法6,PHP中substr函数如何使用?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 读书笔记2013第3本:《无价》
- 下一篇: php input 数组的值,如何获取2