Code: Select all
$s = preg_replace('@<img.*?>@s','',$s);You see, before I learned the @ trick, I was having trouble getting my regex's to not assume characters I was typing were part of the regex.
Moderator: General Moderators
Code: Select all
$s = preg_replace('@<img.*?>@s','',$s);Code: Select all
$s = preg_replace('@<img(.*?)>@s','$1',$s);Whats the @ trick?volomike wrote:before I learned the @ trick
Any character except alphanumerics and backslashes can be used.Kieran Huggins wrote:He's using the @ symbol as the regex delimiter - in PHP you can use (almost?) any symbol for convenience ...
You could improve that regex.volomike wrote:......Code: Select all
$s = preg_replace('@<img.*?>@s','',$s);