<?php
$format = PREG_SPLIT_DELIM_CAPTURE;
$text = "[cat]myString ";
$keywords = preg_split("/([[^]]+])/", $text, -1, $format);
print_r($keywords);
echo "<br/>";
echo "First= ".$keywords[0]; output => blank
echo "<br/>";
echo "Second= ".$keywords[1]; output => [cat]
echo "<br/>";
echo "Third= ".$keywords[2]; output => myString
?>