# Preg\_replace

**URL:** <https://forum.kirupa.com/t/preg-replace/78815>\
**Category:** programming\
**Created:** [February 8, 2005, 11:57am UTC](https://forum.kirupa.com/t/preg-replace/78815 "2005-02-08T11:57:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zebdaag](https://avatars.discourse-cdn.com/v4/letter/z/53a042/32.png) [@zebdaag](https://forum.kirupa.com/u/zebdaag)\
**Post date:** [February 8, 2005, 11:57am UTC](https://forum.kirupa.com/t/preg-replace/78815/1 "2005-02-08T11:57:14Z")

</div>

Hi i’m having a preg\_replace problem.

I have a variable :  
$word

This variable comes from a link someting like:  
\<a href=".$PHPSELF."?word=milk\>milk\</a\>

Now i want to replace all:  
\<a href=".$PHPSELF."?word=$word\>$word\</a\>

With:  
$word

so infact i’m unlinking the word that is the variable can anyone help me with this cause I don’t understand the symbols i can use within the pre\_replace function?

Thanks in advance
