php - Regular Expression for Screen Solution -


i have following string

540x360 [par 1:1 dar 3:2]  

the result want

540x360 

how can , please suggest in future able solve these kind of problem self.

if want use regular expression can use:

$string = "540x360 [par 1:1 dar 3:2]"; $matches = array(); preg_match('/^(\d+x\d+)/i', $string, &$matches); echo $matches[0]; 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -