Düzenli ifade

0 Cevap php

I have an array that its first element might contains something like [some text, here. That's some text] I'm trying to figure out a pattern to check if such string exists and if not create it but having problem with making the pattern. Here's what I've done so far

$pattern = '/^\[*\]$/';
if(preg_match($pattern,$exploded[0])){
    $name = array_shift($exploded);
}else{
    $name = "[Unnamed import] - " .gmdate("His");
}

Ama ben her zaman [Adsız ithalat] olsun - 032758 eminim bile bu model maç

0 Cevap