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