A script that detects hashtags in PHP?
|
11-09-2012, 08:52 PM
Post: #1
|
|||
|
|||
A script that detects hashtags in PHP?
Anybody know how I could create a script that detects hashtags(like twitter) so during the submit script it would find any #then a word. Please help, send me a link to a tutorial or explain how; I know basic php. I'm still learning.
Ads |
|||
11-09-2012, 09:00 PM
Post: #2
|
|||
|
|||
You are going to want to look into php's regular expressions, or regex. This will do what you are looking for. Some people find it complicated at the beginning, but once you understand them, then they become an indispensable tool. Just be careful not to over use them. They are resource heavy and many developers use them in place of inherit string functions. This is a mistake. Learn what the proper uses are for them, and what is simply a waste of resources.
Cheers, Gitlez Ads |
|||
11-09-2012, 09:00 PM
Post: #3
|
|||
|
|||
I dunno.
Something like $match = preg_match('/#/',$yourvariable); if($match) { //do something here } else { //do something else here } maybe? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)