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 ;) 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] 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
Archived
This topic is now archived and is closed to further replies.