Plain form, without regex:

$prefix = 'bla_';
$str = 'bla_string_bla_bla_bla';

if (substr($str, 0, strlen($prefix)) == $prefix) {
    $str = substr($str, strlen($prefix));
} 

Takes: 0.0369 ms (0.000,036,954 seconds)

And with:

$prefix = 'bla_';
$str = 'bla_string_bla_bla_bla';
$str = preg_replace('/^' . preg_quote($prefix, '/') . '/', '', $str);

Takes: 0.1749 ms (0.000,174,999 seconds) the 1st run (compiling), and 0.0510 ms (0.000,051,021 seconds) after.

Profiled on my server, obviously.

Answer from Fabio Mora on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ how-to-remove-the-first-character-of-string-in-php
How to remove the first character of string in PHP? - GeeksforGeeks
July 11, 2025 - ... <?php $string = "Hello World"; ... first character of a string in PHP by converting the string to an array, removing the first element, and then rejoining the array into a string....
๐ŸŒ
PHP
php.net โ€บ manual โ€บ en โ€บ function.substr.php
PHP: substr - Manual
If length is given and is 0, an empty string will be returned. If length is omitted or null, the substring starting from offset until the end of the string will be returned.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-remove-the-first-character-of-string-in-php
How to remove the first character of string in PHP?
<?php $str = "Demo"; echo "Before removing the first character = ".$str; $res = ltrim($str, 'D'); echo " After removing the first character = ".$res; ?>
๐ŸŒ
SitePoint
sitepoint.com โ€บ php
Remove first 2 characters from a string? - PHP - SitePoint Forums | Web Development & Design Community
March 7, 2005 - Ok, I know you can use the substr to only pull some of the characters, but can I strip out only some of the characters, but keep the rest.
๐ŸŒ
sebhastian
sebhastian.com โ€บ php-remove-first-character
PHP remove first character from a string | sebhastian
September 28, 2022 - Because a string index starts from 0, passing 1 as the offset position will cause the function to remove the first character from the string. And thatโ€™s how you remove the first character in PHP.
Find elsewhere
๐ŸŒ
W3Docs
w3docs.com โ€บ php
How to Remove the First Character of a String with PHP
Here is how to run it: ... The Itrim() function is supported on PHP 4, PHP 5, and PHP 7 versions. This function is used for returning a string with whitespace stripped from the beginning of the string.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ how-to-remove-first-element-from-an-array-in-php
How to Remove First Element from an Array in PHP? - GeeksforGeeks
July 23, 2025 - The array_shift() function removes the first element from an array and returns it. This function modifies the original array. ... <?php $arr = array(10, 20, 30, 40, 50, 60); $removedElement = array_shift($arr); echo "Removed element: " . ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ remove-first-element-from-an-array-in-php
Remove First Element from an Array in PHP - GeeksforGeeks
July 23, 2025 - The array_shift() function removes the first element from an array and returns it. This function also re-indexes the array so that the keys start from 0 again. Example: This example shows the implementation of the above-explained approach.
๐ŸŒ
PHPBuilder
board.phpbuilder.com โ€บ d โ€บ 10218274-remove-first-characters-of-string-in-array
remove first characters of string in array. - PHPBuilder Forums
November 21, 2002 - I got a array filled with strings. What I want to do is remove the first three characters (numbers) of every string in the array. The strings look like this...
๐ŸŒ
Reactgo
reactgo.com โ€บ home โ€บ remove the first character of a string in php
Remove the First Character of a string in PHP | Reactgo
November 12, 2023 - To remove the first character of the string, we can use the built-in substr() function by passing string , 1 as a arguments. It returns a new string by removing the first character.
๐ŸŒ
TutorialKart
tutorialkart.com โ€บ php โ€บ php-delete-first-character-of-string
PHP - Delete first character in string
May 7, 2023 - Check if specific element is present in array. ... In this PHP tutorial, you shall learn how to delete the first character from given string using substr() function, with example programs.
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ faq โ€บ how-to-remove-the-first-element-from-an-array-in-php.php
How to Remove the First Element from an Array in PHP
<?php $hobbies = array("Acting", "Drawing", "Music", "Films", "Photography"); // Deleting first array item $removed = array_shift($hobbies); print_r($hobbies); echo "<br>"; var_dump($removed); ?>
๐ŸŒ
Tutorialdeep
tutorialdeep.com โ€บ knowhow โ€บ php faqs โ€บ how to remove first and last character of string in php
How to Remove First and Last Character of String in PHP
May 13, 2021 - To remove the first character of string in PHP, you have to use the substr() function. In this function, you have to pass two arguments in which the first argument is a string variable and the second is 1.