- array_combine: documentation ( source)
- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$text = '/* name for an item that is duplicated in the UI, based on the original name / "%@ (Copy)" = "%@ (kopi)"; / display name for a book page template that is the first page of that section / "%@ (First)" = "%@ (Første)"; / display name for a book page template that represents a hardcover cover. the second argument is the cover type. */ "%@ (Hardcover, %@)" = "%1$@ (Hard innbinding, %2$@)";';
preg_match_all('#"([^"]+)"\s*=\s*"([^"]+)";#', $text, $match);
$translate = array_combine($match[1], $match[2]);
print_r($translate);