Create an array of elements from text between # tag

preg_match_all('/#(.*?)\#/s', $text, $matches);
print_r($matches);

Ex: janaki #ranjan# mahapatra #my name#
Output: array[0=>ranjan,1=>myname];

0

About the author

Janaki(http://mjanaki.com) - A Software developer with 9+ years of experience in multiple technology projects across web, mobile, and cloud applications with expertise in PHP, C#, MySQL, Web services and open source platforms.

Similar Posts

VMWare shared folder as apache vhost
IIS redirect

Comments are closed.