newbtophp Posted April 30, 2010 Share Posted April 30, 2010 Hi, I want to use preg_match_all(), but want to add the line numbers to the array for each of the matches, how would this be achieved? Quote Link to comment https://forums.phpfreaks.com/topic/200310-adding-line-numbers-to-matched-array/ Share on other sites More sharing options...
newbtophp Posted April 30, 2010 Author Share Posted April 30, 2010 I was thinking of integrating file() to retrieve the line nums?, so the final array would consist of the match along with the line number. //matches //lines nums $matches = array( "some match" => 45 ); Quote Link to comment https://forums.phpfreaks.com/topic/200310-adding-line-numbers-to-matched-array/#findComment-1051270 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.