$string = "PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION";
$exploded = explode("::",$string);
/*
explode('::',$string) = eliminate every :: and for each division of ::make an array element
Example:
PDO::ERRMODE_EXCEPTION (exploded) = array (
[0] => string PDO
[1] => string ERRMODE_EXCEPTION
)
Example:
$exploded[0] = "PDO";
*/
foreach ($exploded as $index) {
echo $index . "\n";
}
/*
Output:
PDO
ATTR_ERRMODE => PDO
ERRMODE_EXCEPTION
*/