<?php $data = "CN=Carina Costa(42353),OU=Administrativos,OU=Amadora,OU=Utilizadores,DC=hluz,DC=ess,DC=local"; $pattern = '/=([^,]+)/'; $matches = []; preg_match($pattern, $data,$matches); $result = count($matches)? $matches[1]:null; //the match, or NULL var_dump($result);
You have javascript disabled. You will not be able to edit any code.