# str\_replace help

**URL:** <https://forum.kirupa.com/t/str-replace-help/205937>\
**Category:** programming\
**Created:** [November 3, 2006, 10:38am UTC](https://forum.kirupa.com/t/str-replace-help/205937 "2006-11-03T10:38:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 3, 2006, 10:38am UTC](https://forum.kirupa.com/t/str-replace-help/205937/1 "2006-11-03T10:38:08Z")

</div>

hello all

i’ve pulled this function of the [php.net](http://php.net) site

```php

function format_html($content){
	$content = "<p>" . str_replace("
", "<br/>", $content) . "";
	$content = "" . str_replace("<br/><br/>", "</p><p>", $content) . "";
	return "" . str_replace("<br/><li>", "<li>", $content) . "";
}

```

so when you call the function

```php
<?php echo format_html("$copy</p>"); ?>

```

it replaces all the

```auto

 with <br /> and <p> </p> 

```

Now i was wondering how could i edit this code so it also accepts my own code such as replacing

```auto
<bold> </bold> with <b></b>

```

I’ve tried editing the above function and for the life of me i have no clue

any help would be great =)
