The following will return you the "a" letter:
$a = array_shift(explode('.', 'a.b'));
$array = explode('.',$string);
Returns an array of split elements.
to explode with '.' use
explode('\\.','a.b');
explode('.', $string)
If you know your string has a fixed number of components you could use something like
list($a, $b) = explode('.', 'object.attribute');
echo $a;
echo $b;
Prints:
object
attribute
$string_val = 'a.b';
$parts = explode('.', $string_val);
print_r($parts);
explode('.', 'a.b');
Source: Stackoverflow.com