当前位置:网站首页>mb_ substr()、mb_ Strpos() function (story)
mb_ substr()、mb_ Strpos() function (story)
2022-04-23 01:39:00 【Savanna07】
In today's buu Did one web The subject of , stay php The audit saw mb_substr()、mb_strpos() I don't know much about functions , I checked the first-hand information on the Internet to understand , Close up here to record
I don't say much nonsense , Go straight to the point
mb_substr() function
Before we know this function , We need to know its little brother first substr() function
its substr() The function is a function that returns part of a string , First explain what this little brother looks like
substr(string,start,length) / / If star The argument is negative and length Less than or equal to start, be length by 0
In this way, there may be a little partner or I don't know this little brother very well , Then after reading this story, you will be able to have a great understanding of this
Aside : The younger brother substr() And big brother md_substr() The two brothers set up a company together , No, it's just the opening of their two companies today
The younger brother : Hello everyone , My name is substr(), I am a function specially used to output part of the string you pass in , My big brother has the same function as me , But ah, it can be used in many languages , But I only use it in English . Let's hear if my big brother is awesome
eldest brother : Stop talking nonsense , Let's get into talent
Aside : Just after opening, a party a came to cooperate with them
Party a father : My project is very simple , Just do what I want [substr("hello world",6)] This is the plan
eldest brother : I'll leave such a small project to you
The younger brother : Come on, brother , Good guy, I'm busy again , A meal operation output “world”
Party a father : I feel this world Not very good , Can you change this [substr("hello world",6,4)] try
The younger brother : Party A's father is not satisfied , Elder brother, have I failed too much
eldest brother : It's not normal for Party A to ask for more , Keep doing it
The younger brother : The eldest brother spoke. I have to do this , I have another good meal , Suddenly output again “wor”
Party a father : What is this? This is , It's so ugly , The original one is better , Take that. 4 Switch to 5 got
The younger brother : Come on, let's go , I don't want to rush out again “worl”
Party a father : good heavens , I don't want to output 5 Well, here , What's going on? What's going on 4 One !! Isn't it unprofessional? You
eldest brother : Don't be angry, father , I'm a newcomer and I'm not sensible , But here we are php Language is closed on the left and open on the right , It can only get the previous one of the specified number , It's not easy for us to break this old rule, right
The younger brother :5555 eldest brother 5555
Party a father : All right, all right. , Then put this, that 5 Change to 6 Output it to me and finish it
eldest brother : Don't worry, you must be OK this time
[substr("hello world",6,6)] Successfully output again “world”
Party a father : It can be done well , I have a friend here who also has a project [$str=' It's today Monday'] I need to find you , He wants to export “ yes Monday”
The younger brother : Oh, brother, this is a big project , I can't do this
eldest brother : Be careful. I'll take over this big project myself
eldest brother :[md_substr(" It's today Monday",2)] Party A's father, look at this. Are you satisfied
Party a father : It's worthy of being a big brother , One shot is extraordinary ! This cooperation is very pleasant
eldest brother 、 The younger brother : looking forward to your next visit !
mb_strpos() function
That day, a recruiter came to the two brothers' company , Claiming to be a distant relative of big brother mb_strpos() function
eldest brother : Good guy, let me see which distant relative of mine
see mb_strpos() Just stepped into the door of the company , Big brother immediately hugged him
eldest brother : Cousin, I haven't seen you for a long time , You have changed so much that you can hardly recognize it
The younger brother : eldest brother , This is really your distant relative
elder male cousin : I heard you started a company in a big city , I'll come to you right away
eldest brother : Ouch, cousin , What skills did you bring to the interview today
The younger brother : Our company won't keep idle people
elder male cousin : Now I've brought my housekeeping skills , Rest assured
The younger brother : Well, show us your housekeeping skills
elder male cousin : I have golden eyes , Very sensitive to find , If you want to know the position of that character, I can tell you immediately , And I don't know any language , English or Chinese is OK !
The younger brother : Hey, I don't believe it
eldest brother : Let's have one on the spot ?!$str‘jintianyoudianxihuanni’, Please tell me y and n The location of
elder male cousin :7!!!!2!!!1
eldest brother : Yes, cousin , This skill is good ! Congratulations on your admission, cousin
The younger brother : No, big brother , that n There are so many positions , It only said one
elder male cousin : You don't know something about this man , Although our eyes are sharp , But we can only use this function once for each character , So we can only find the first one
eldest brother : Ouch! , This admission is too fast ( Remorse )
This is the end of the story. I wonder if you understand these two functions ~
There will be another issue !!!
版权声明
本文为[Savanna07]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230136106026.html
边栏推荐
- GBase 8s查询处理和优化
- The most understandable life cycle of dependency injection
- [蓝桥杯][2019年第十届真题]外卖店优先级
- Gbase 8s group by function introduction
- 42、使用mmrotate中k3det进行旋转目标检测,并进行mnn部署和ncnn部署
- Good test data management, in the end how to do?
- Blocking granularity of gbase 8s concurrency control
- 01 knapsack problem - and deformation problem
- Gbase 8s数据库日志简介及管理
- .NET(C#) MySQL conn.Open()报错:SSL Connection error的解决方法
猜你喜欢
LSF的使用方法总结
gin--hello
Chris LATTNER, father of llvm: the golden age of compilers
Small example of gin - get request 2-handle handles post requests
Activity preview | on April 23, a number of wonderful openmldb sharing came, which lived up to the good time of the weekend!
42、使用mmrotate中k3det进行旋转目标检测,并进行mnn部署和ncnn部署
计蒜客:数独(DFS)
第六章 使用 matplotlib 绘制热力图
科技云报道:云计算进入“下半场”,国产云的出路在哪儿?
Unrelated interprocess communication -- creation and use of named pipes
随机推荐
Gbase 8s query processing and optimization
王子救公主(DFS)
GBase8s SQL 引擎框架简介
Innovative practice of short video content understanding and generation technology in meituan
Introduction to gbase 8s storage structure and space management
Soatest preliminary understanding
什么是布尔类型?
Detonate the bomb (DFS)
GBASE 8s 共享内存缓冲池介绍
FL studio20.8最新中文版本安装下载图文教程
角色個人屬性英文縮寫
2n皇后问题
引爆炸弹(DFS)
Completely uninstall antidote 10? What if the antidote uninstall is not clean?
Android sqliteopenhelper data table structure upgrade
Gbase 8s Group by 功能介绍
四级城市地区表 xlsx, sql文件,国内,中国省市县街道乡镇四级地址 (名称,联动ID,层级,是否末级(1-是))
力扣(LeetCode)112. 路径总和(2022.04.22)
Futr3d: a unified 3D detection framework for sensor fusion
[registration] tf54: engineer growth map and excellent R & D organization building