Hamlets666 Posted January 14, 2007 Share Posted January 14, 2007 So there is a long text. For example:[i]Lol [xc] pop [lo][/i]I want to get in array txt which is between [ and ]Like $arr[0] would be xc and $arr[1] would be lo.I hope you understand ;) Quote Link to comment https://forums.phpfreaks.com/topic/34106-need-help-with-reg-exp/ Share on other sites More sharing options...
.josh Posted January 14, 2007 Share Posted January 14, 2007 [code]<?php $blah = "Lol [xc] pop [lo]"; preg_match_all("/\[(.*?)\]/i", $blah, $matches); $arr = $matches[1];?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/34106-need-help-with-reg-exp/#findComment-160403 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.