Get the App
SLTechnology News&Howtos  ›  Development  › 

How php displays only part of the characters

Shulou Source: shulou.com Published: 2022-05-31 18:38:51 10月03日 Update

This article mainly explains "how php only displays some characters". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "how php only displays some characters" together!

Display method: 1. Use substr() to intercept characters of specified length from the string and return them, syntax "substr(string, start position, number of characters)";2. Use substr_replace(), syntax "substr_replace(string,'', start position, remove number of characters)".

Operating environment of this tutorial: Windows 7 system, PHP7.1 version, DELL G3 computer

php shows only some characters

Substr()

The substr(string,start,length) function intercepts a character of length from the specified position start in a string.

Examples:

Substr_replace()

The substr_replace() function replaces part of a string with another string.

When the substitution value is set to null, the specified character is deleted, leaving another part of the substring.

Thank you for reading, the above is "php how to display only some characters" content, after learning this article, I believe we have a deeper understanding of how php only displays some characters, the specific use of the situation also needs to be verified. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Characters strings parts locations learning number content functions methods grammar length that is ideas situations tutorials articles more environment computer knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Shulou Technology Shulou Information Huawei