# str\_replace html code: simple?

**URL:** <https://forum.kirupa.com/t/str-replace-html-code-simple/189615>\
**Category:** programming\
**Created:** [June 4, 2006, 5:31pm UTC](https://forum.kirupa.com/t/str-replace-html-code-simple/189615 "2006-06-04T17:31:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logikal2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/logikal2/32/1143_2.png) [@logikal2](https://forum.kirupa.com/u/logikal2)\
**Post date:** [June 4, 2006, 5:31pm UTC](https://forum.kirupa.com/t/str-replace-html-code-simple/189615/1 "2006-06-04T17:31:36Z")

</div>

Hey,

this is probably an easy problem to solve but here’s the deal:

i’m using str\_replace to get rid of extra (unneeded) breaks (\<br /\>) from a string, but it’s not working. in this case, i want to remove the first \<br /\> after \<hr /\>. here’s a sample of $str:

```auto
<div class='h1'> Welcome to the Actionscript 2.0 Wiki </div><hr />
<br />View the <a href="wiki.php?id=todo">todo</a> list for future changes.
<br />
<br /><b>Why...

```

```php
$str = str_replace("<hr /><br />","<hr />",$str);

```

What i’m trying to do is replace the \<hr /\>\<br /\> with JUST \<hr /\>. However, i guess i need something else in between “\<hr /\>\<br /\>” in the above code?

Thanks in advance  
Matt :book:
