Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $aTag = '<a href="news-test/ams-list-dev.html#c131546" class="fancy-link" rel="131546">';
- $regex = '/(href="[^#]+(#[A-Za-z0-9]+)")/';
- if(preg_match($regex,$string,$matches)) {
- $search = $matches[0];
- $replace = 'href="'.$matches[2].'"';
- $newATag = str_replace($search,$replace,$string);
- }
- ?>
Add Comment
Please, Sign In to add comment