I'm having problem understanding Regular Expression. Here is what I've got
$pat = "/<[^>]*>/";
This pattern works well in removing all the HTML tags. But when it's used to remove <?php ?>
tags, it has problem when ->
exist in between the tag.
i.e
<?php
$obj->name;
$obj->reset();
?>
some other things outside
Intended result
some other things outside
The actual result
name;
$obj->reset();
?>
some other things outside
So, how can I exclude the ->
in my search?