Preg_replace and preg_match to get and replace HTML / PHP content
问题 I need to extract some HTML / PHP content and put it into an array. Here is what I have The code below is within a string called $string for example. <html> <?php myclass->my_function('First', 'Last'); ?> <p>Some other content</p> <?php myclass->my_function(1, 2, 3); ?> </html> I want to find all the values from the functions and sum them into an array with preg_match. Only myclass->my_function function values should be found. The array should look like this $array = array( 1 => array('First'