I have the following String
Hi this string is to @removeStart be modified by @removeEnd function
And I want to remove the string part coincides by @removeStart
and @removeEnd
and these two tags from the above string
I have the following String
Hi this string is to @removeStart be modified by @removeEnd function
And I want to remove the string part coincides by @removeStart
and @removeEnd
and these two tags from the above string
Try this
$str = 'Hi this string is to @removeStart be modified by @removeEnd function';
echo preg_replace('/@removeStart (.*) @removeEnd/','',$str);
(@\b\w+)
<?php
$str="Hi this string is to @removeStart be modified by @removeEnd function";
echo preg_replace('(@\b\w+)','',$str);
?>
Hi this string is to be modified by function