php.org PHP Logo
Beginner Intermediate Advanced

Search results for: "substr"

Are there any best practices for handling false values with substr() in PHP?

When using substr() in PHP, it's important to handle false values that may be returned if the function encounters an error. One way to handle this is...

What are some common pitfalls when using substr() in PHP for string manipulation?

One common pitfall when using substr() in PHP for string manipulation is not considering the starting index and length parameters correctly. If the st...

What is the purpose of the PHP function "substr" and how can it be used to truncate a string?

The purpose of the PHP function "substr" is to extract a portion of a string. To truncate a string using the "substr" function, you can specify the st...

Are there any potential performance pitfalls when using the substr function in PHP to limit the output of a field?

Using the substr function in PHP to limit the output of a field can potentially lead to performance pitfalls, especially if the field contains a large...

Are there any performance differences between using substr() and $string{0} to extract the first character of a variable in PHP?

When extracting the first character of a string variable in PHP, using substr() and $string{0} both achieve the same result. However, there may be a s...

Showing 41 to 45 of 992 results

‹ 1 2 ... 6 7 8 9 10 11 12 ... 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.