Parsedown::pregReplaceElements( $regexp, $Elements, $text )
Replace occurrences $regexp with $Elements in $text. Return an array of elements representing the replacement.
Description
Source
File: bp-help/vendors/parsedown/Parsedown.php
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | protected static function pregReplaceElements( $regexp , $Elements , $text ) { $newElements = array (); while (preg_match( $regexp , $text , $matches , PREG_OFFSET_CAPTURE)) { $offset = $matches [0][1]; $before = substr ( $text , 0, $offset ); $after = substr ( $text , $offset + strlen ( $matches [0][0])); $newElements [] = array ( 'text' => $before ); foreach ( $Elements as $Element ) { $newElements [] = $Element ; } $text = $after ; } $newElements [] = array ( 'text' => $text ); return $newElements ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.