Welcome Guest, Not a member yet? Register   Sign In
Searching a string for a character and all the characters till the next whitespace?
#3

[eluser]kyleect[/eluser]
Thanks for the reply and answer. Ok, I tried this but it didn't work. Here is the exact code I'm using:

Code:
<?php
    echo nl2br(preg_replace('/#([a-z0-9])\s/i', '<a href="$1">$1</a>', $post['body']));
?&gt;

$post['body'] contains the following:

Code:
test test test

#test_post

It didn't generate any errors but didn't create the hyperlink either. Can you see anything I'm doing incorrectly?


Messages In This Thread
Searching a string for a character and all the characters till the next whitespace? - by El Forum - 08-05-2009, 04:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB