Did you ever try converting hashtags in your website into links of a post or comments…?
Did you ever try to learn it from other sources…?
Look how Facebook Team did it in PHP using Regular Expressions…
Today I will teach you how to do that easily in PHP Regular Expressions.
Lets start now…
First retrieve the content of the post using $_POST in php
echo convertToHash($_POST['hashtag']);//convertToHash is a function for converting hashtags into urls…
//declare a regular expression…
$regex = "/#+([a-zA-Z0-9_.]+)/";
$string = preg_replace($regex,'<a href="http://facebook.com/$1″ target=”_blank”>$0‘, $str);
To use this function just use the html form…