- array_combine: documentation ( source)
- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$string = 'paypal_merchant_email="sample@ymail.com"|paypal_verified_only="0"|payment_currency=""|sandbox="1"|sandbox_merchant_email="sample@ymail.com"|payment_logos=""|debug="0"|status_pending="W"|status_success="O"|status_canceled="D"|countries=""|min_amount="0"|max_amount="0"|secure_post=""|ipn_test=""|no_shipping="0"|address_override="0"|cost_per_transaction="0"|cost_percent_total="0"|tax_id=0|';
preg_match_all('/\|(.*?)="(.*?)"/', '|'.$string, $matches);
$result = array_combine($matches[1], $matches[2]);
print_r($result);