- str_getcsv: documentation ( source)
- explode: documentation ( source)
<?php
$str = '"Harry":"12345","Biswas":"789456","garry":"56894"';
$passwords = array();
foreach( str_getcsv( $str) as $entry) {
list( $name, $pw) = explode( ':', $entry);
$passwords[$name] = $pw;
}
echo $passwords["Harry"]; // 12345