Yngvarr

Generation

generate functionFri, 09 Dec 2022

вернуть часть текста до и после регулярное

function preg_split_text_by_regex($text, $regex) { $result = preg_split($regex, $text); return [ 'before' => $result[0], 'after' => $result[1] ]; }

Questions about programming?Chat with your personal AI assistant