Tagged articles
9 articles
Page 1 of 1
JavaScript
JavaScript
Jun 6, 2025 · Frontend Development

Why slice() Beats substr() and substring() in Modern JavaScript

This article explains the three JavaScript string extraction methods—substr(), substring() and slice()—highlighting why slice() is now preferred, detailing deprecation reasons for substr(), comparing behavior, parameter handling, and consistency, and summarizing its advantages over the other methods.

JavaScriptSliceString Methods
0 likes · 4 min read
Why slice() Beats substr() and substring() in Modern JavaScript
Laravel Tech Community
Laravel Tech Community
Oct 10, 2020 · Backend Development

PHP mb_strstr() – Find First Occurrence of a Substring

The article explains PHP’s mb_strstr() function, detailing its syntax, how it finds the first occurrence of a needle in a haystack, the optional before_needle and encoding parameters, and the return values including FALSE when the needle is absent.

BackendPHPSubstring
0 likes · 2 min read
PHP mb_strstr() – Find First Occurrence of a Substring
Laravel Tech Community
Laravel Tech Community
Sep 30, 2020 · Backend Development

PHP mb_substr_count: Counting Substring Occurrences

The article explains PHP's mb_substr_count function, detailing its syntax, parameters, return value, and provides a practical example showing how to count the number of times a substring appears within a multibyte string.

BackendStringSubstring
0 likes · 2 min read
PHP mb_substr_count: Counting Substring Occurrences