Hi,
I still have some problems ...
my current code is:
$pattern = "/([a-z]+)\(([0-9]+)\)([a-z]+)|([a-z]+)\(([0-9]+)\)|([a-z]+)/i";
$type = 'int (20) unsigned';
//$type = 'int(20)';
//$type = 'text';
$type = preg_replace('/\s+/','', $type);
if(preg_match($pattern, $type, $out))
{
echo 1;
}
echo "<pre>".print_r($out,true);
so far it works ok as OR ...
if i try:
$type = 'int(20) unsigned';
iget
Array
(
[0] => int(20)unsigned
[1] => int
[2] => 20
[3] => unsigned
)
if i try $type = 'int(20)';
Array
(
[0] => int(20)
[1] =>
[2] =>
[3] =>
[4] => int
[5] => 20
)
an if i try : $type = 'text';
i get:
Array
(
[0] => text
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] => text
)
it works, but the problem is i want to use just
[1],[2],[3] without having empty values ...
is the possible just with RegEX ...
Thank you in advance ...