- str_getcsv: documentation ( source)
- trim: documentation ( source)
<?php
$string = '"dhcp-class-identifier ""Wireless Broadband R,outer""", "dhcp-client-identifier """"", "host-name ""Wireless_Broadband_Router""", "domain-name ""home"""';
$options = str_getcsv($string, ',', '"', '\\');
foreach ($options as $option) {
$send_options .= "\tsend " . trim($option) . ";\n";
}
echo $send_options;