当前位置:网站首页>Interviewer: let's talk about some commonly used PHP functions. Fortunately, I saw this article before the interview
Interviewer: let's talk about some commonly used PHP functions. Fortunately, I saw this article before the interview
2022-04-23 09:47:00 【Flower less venerable】
preface :PHP Is a general open source scripting language , Various functions will be encountered in both the development process and the interview process , Today, let's sort out the commonly used functions .

character string (string) function
strlen: Get string length , bytes substr_count: Count the number of times a substring appears in a string substr: String interception , Get string ( Intercept by byte )strchr: And substr be similar , Intercept from the specified location until the end strrchr( Get file suffix ): And strchr equally , Just start looking for characters from the right strtolower: All characters are lowercase ( For English letters )strtoupper: All characters are capitalized strrev: String inversion ( Can only reverse English : English storage has only one byte ), Reverse by byte strpos: Find the position of the corresponding character from the string ( Numeric subscript ), Start from the far left strrpos: And strpos equally , Just start from the right side of the string trim: Remove the characters on both sides of the function , Default is space str_split The function splits a string into an array .chunk_split: Break the string into a series of smaller parts str_repeat: Repeat the string a specified number of times str_replace: Replace some characters in a string ( Case sensitive )ucfirst : Convert the first character of a string to uppercase date (date) function
time: Returns the... Of the current time Unix Time stamp date: Format local date and time strtotime: Parse the date or time description of any English text into Unix Time stamp microtime: Returns the current Unix The microseconds of the timestamp Numbers (math) function
abs: The absolute value floor: Rounding down ceil: Rounding up round: rounding rand: Gets a random integer in the specified range mt_rand: Gets a random integer in the specified range ( More efficient )min: Returns the smallest value in an array , Or the smallest of several specified values max: Returns the maximum value in an array , Or the maximum of several specified values Array (array) function
count: Returns the number of elements in the array key: Get the key name from the associated array current: The current pointer obtained points to the value of the element next: Get the value of the next element , And move the pointer down prev: Get the value of the previous element , And move the pointer up end : Move the pointer to the last element of the array , And return the value of the final pointer position reset: Move the pointer to the first element of the array , Returns the value of the final pointer position array_keys: Get all the key names of an array , Returns an index array array_values: Get all the values of an array , Returns an index array explode: Break a string into an array implode: Returns a string composed of array elements join: implode() Another name for array_merge: Combine one or more arrays into an array array_reverse : Returns the inverted array array_flip : Swap keys and values in an array array_shift: Pop up elements from the front of the array , Get the value of the element array_pop: Pop up elements from the back of the array , Get the value of the element array_unshift: Push in elements from the front of the array , Get the number of current array elements array_push: Push in elements from the back of the array , Get the number of current array elements Judgment function
is_bool: Determine whether it is Boolean is_float: Determine whether it is floating point is_integer: Determine whether it is an integer is_object: Judge whether it is the object is_array: Determine if it's an array is_string: Whether the string is is_resource: Determine if it's a resource is_null : Check whether the variable is NULLis_numeric: Judge the string composed of numbers or pure numbers isset: Judge whether it is defined summary
The functions listed above are only a common part , Interested friends can search “ Novice tutorial ” Go and check the relevant PHP course .
I'm a small program software developer , Share the knowledge points encountered in the development process every day , If it helps you , Give me a favor before you go , Thank you very much .
Share previous articles :
php An online that can be installed on the server api Document authoring tools :showdoc
1 Minutes to build FTP Server side , With this software, it can be so simple
版权声明
本文为[Flower less venerable]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230938565328.html
边栏推荐
- Example of data object mask used by SAP translate
- 元宇宙时代的职业规划与执行
- PHP笔记(一):开发环境配置
- [geek challenge 2019] havefun1
- KVM installation and deployment
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》
- SAP RFC_ CVI_ EI_ INBOUND_ Main BP master data creation example (Demo customer only)
- Go language learning notes - exception handling | go language from scratch
- Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail
- 构建元宇宙时代敏捷制造的九种能力
猜你喜欢

#yyds干货盘点#ubuntu18.0.4安装mysql并解决ERROR 1698: Access denied for user ''root''@''localhost''

Redis 内存占满导致的 Setnx 命令执行失败

Introduction to sap pi / PO login and basic functions

个人主页软件Fenrus

Solving Lucas number and combination theorem

高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?

Installation of data cleaning ETL tool kettle

《信息系统项目管理师总结》第八章 项目干系人管理

论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——3背景

Exclusive thoughts and cases of JS
随机推荐
Go language learning notes - array | go language from scratch
Acquisition of DOM learning elements JS
面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章
Es aggregation aggregation analysis
ABAP CDs view with association example
如何实现根据照片获取地理位置及如何防御照片泄漏地理位置
Planning and construction of industrial meta universe platform
亚马逊云科技入门资源中心,从0到1轻松上云
JS DOM learn three ways to create elements
[hdu6868] absolute math (pusher + Mobius inversion)
Epidemic prevention registration applet
(Extended) bsgs and higher order congruence equation
Amazon cloud technology entry Resource Center, easy access to the cloud from 0 to 1
JSON input of Chapter 14 of kettle paoding jieniu
[COCI] lattice (dichotomy + tree divide and conquer + string hash)
NEC红外遥控编码说明
SAP pi / PO function operation status monitoring and inspection
Kettle experiment
How to use SQL statement union to get another column of another table when the content of a column in a table is empty
Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files