- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$matches=array();
preg_match_all('/(.*?):(?:".*?"|.*?)(?=\r?\n|\r\n?)/s', 'name: dc_tun_2943
remote-gateway: 83.113.63.244:4500
lifetime/rekey: 21600/9358
inbound:"
spi: 0a23d4b9
enc: aes 0f076cac2c56262e87595b89628394ff
auth: sha1 dfe2b661f857725fbcf7f14976dae6ded3f4e824"
outbound:"
spi: cf34c010
enc: aes d463c815a141f714dbc58cdddde04bec
auth: sha1 e5af683ab3f83634bca4eeb3ac081e7a7de2e5a1"
', $matches);
var_dump($matches);