<?php $input = 'Wires: 8 Pairs: 4'; echo preg_replace_callback( '/Wires: (\d+) Pairs: (\d+)/', fn($m) => sprintf( 'Wires: %d Pairs: %d', $m[1] / $m[2], $m[2] ), $input );
You have javascript disabled. You will not be able to edit any code.