- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$url = 'https://my.heyform.net/workspace/nTM2Qfqi/project/sG6hdyag/form/Oc5hsIl3/create';
if (preg_match('#/form/([^/]+)/create#', $url, $matches)) {
print_r($matches);
}