I'm creating a kind of a blog sharing link. Basically, for each link i would extract hashtag from post string and put it into a meta tags and keywords.
So, string normally is like this
#helloworld #test #video #youtube Bon Iver are the best daily surprise :D
Now, how can i get only hashtags and insert into a string like this ?
$hashtags = helloworld,test,video,youtube
And after insert hashtags in meta tag
<meta name="keywords" content="<? echo $hashtags ?>" >
<meta name="tags" content="<? echo $hashtags ?>">
Actually i used this script to remove "#" and put ","
$hashclear = preg_replace('/#([A-Za-z0-9]+)/', '$1,', $post);
How can i get these ? Any ideas ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…