Edit report at https://bugs.php.net/bug.php?id=39962&edit=1
ID: 39962 Patch added by: datib...@php.net Reported by: pjoe444 at hotmail dot com Summary: Suggestion: SUBSTR_ADD Function Status: Open Type: Feature/Change Request Package: *General Issues PHP Version: 5.2.0 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: substr_insert.patch Revision: 1314113875 URL: https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314113875 Previous Comments: ------------------------------------------------------------------------ [2011-08-23 14:28:57] ar...@php.net substr_replace() already provides this when the length argument is 0. ------------------------------------------------------------------------ [2011-08-23 14:08:50] datib...@php.net The following patch has been added/updated: Patch Name: substr_insert.patch Revision: 1314108530 URL: https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314108530 ------------------------------------------------------------------------ [2011-08-23 14:05:14] datib...@php.net The following patch has been added/updated: Patch Name: substr_insert.patch Revision: 1314108314 URL: https://bugs.php.net/patch-display.php?bug=39962&patch=substr_insert.patch&revision=1314108314 ------------------------------------------------------------------------ [2006-12-27 14:55:17] pjoe444 at hotmail dot com ( SUBTRACTION, on the other hand, does work simply enough with the current system: with SUBSTR_REPLACE being able to replace a character with an empty string "" ) ------------------------------------------------------------------------ [2006-12-27 14:42:30] pjoe444 at hotmail dot com Description: ------------ SUGGESTION to the PhP Group (I did not find any place for suggestions on the site: the suggestion links seem to point here) How about a SUBSTR_ADD function similar to substr_replace substr_add (mixed string, string replacement, int start [, int length] ) example when handling time (in schedules etc) $var=1245 $var= substr_add ($var, ':', 2); $var value now 12:45 Yes-- you can split and add and rejoin strings, or probably use preg_replace, but I am surprised that such a simple useful facility does not seem to be available in PHP ! :-( Thanks! Peter Douglas Reproduce code: --------------- N/A Expected result: ---------------- N/A ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=39962&edit=1