carloscarucce/substr-position

substr_position function for php 7.1+

v1.1 2022-05-24 18:00 UTC

This package is auto-updated.

Last update: 2024-10-25 00:03:03 UTC


README

Installation

composer require carloscarucce/substr-position

Examples

Examples:

//Basic usage
$original = 'test';
$valueToAdd = 'abc';
substr_position($original, $valueToAdd, 2); //string(5) "teabc"

//Limiting result size
substr_position("test", "abc", 2, 4); //string(4) "teab"

//Adding to a position beyond original string maxlength
substr_position("test", "abc", 10); //string(13) "test      abc"