当前位置:网站首页>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
边栏推荐
- Kettle experiment conversion case
- Your guide to lowering your cholesterol with TLC (continuously updated)
- MySQL of database -- Fundamentals
- C语言:表达式求值(整型提升、算术转换 ...)
- kettle庖丁解牛第14篇之JSON输入
- Kettle experiment
- MySQL of database -- basic common query commands
- KVM installation and deployment
- ABAP 7.4 SQL Window Expression
- Two declaration methods of functions of JS
猜你喜欢

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

Set the maximum width of the body, but why does the background color of the body cover the whole page?

Kettle experiment

Go language learning notes - structure | go language from scratch

Alibaba cloud architects interpret the four mainstream game architectures

ABAP 7.4 SQL Window Expression

MySQL of database -- basic common query commands

JS node operation, why learn node operation

Simple understanding of arguments in JS

Example of data object mask used by SAP translate
随机推荐
Expansion of number theory Euclid
How to obtain geographical location based on photos and how to prevent photos from leaking geographical location
[CF 1425d] danger of mad snakes
Kettle experiment
Golang force buckle leetcode 396 Rotation function
从知识传播的维度对比分析元宇宙
Introduction to graph theory -- drawing
Career planning and implementation in the era of meta universe
Where is int a = 1 stored
Enter "net start MySQL" and "system error 5. Access denied" appears. Detailed explanation of the problem
#yyds干货盘点#ubuntu18.0.4安装mysql并解决ERROR 1698: Access denied for user ''root''@''localhost''
JS node operation, why learn node operation
云身份过于宽松,为攻击者打开了大门
Flutter 的加载动画这么玩更有趣
MySQL - Chapter 1 (data types in MySQL)
Integral function and Dirichlet convolution
ABAP implementation publishes restful services for external invocation example
Vivo, hardware safe love and thunder
DVWA range practice
Redis expired key cleaning and deletion policy summary