php.org PHP Logo
Beginner Intermediate Advanced

Search results for: "substr"

How can the use of substr in PHP be optimized to avoid adding unnecessary characters like "..."?

When using the substr function in PHP to limit the length of a string, it may add unnecessary characters like "..." at the end if the string is longer...

What are the potential issues with using the substr function in PHP, especially when used multiple times?

Using the substr function in PHP multiple times can lead to performance issues, as each call creates a new substring from the original string. To solv...

How can substr() be properly used in conjunction with preg_match in PHP?

When using preg_match in PHP to extract a specific substring from a string, you can use substr() to extract the matched substring based on the preg_ma...

What are some potential pitfalls when using the substr function in PHP?

One potential pitfall when using the substr function in PHP is not considering the character encoding of the string being manipulated. This can lead t...

How can passing null to the parameter #1 of substr() in PHP be avoided to prevent deprecated warnings?

When passing null to the parameter #1 of substr() in PHP, it can lead to deprecated warnings as of PHP 7.1. To avoid this, you can explicitly check if...

Showing 11 to 15 of 992 results

‹ 1 2 3 4 5 6 7 8 9 10 ... 198 199 ›
PHP.ORG

A free knowledge base for PHP developers. Open to all.

Legal

  • About
  • Contact / Imprint
  • Terms
  • FAQ

© 2025 php.org. All rights reserved.