You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array
(
[0] => BlueLibraries\Dns\Records\Types\TXT Object
(
[data:protected] => Array
(
[host] => txt.test.bluelibraries.com
[ttl] => 3600
[txt] => heroes never die - eroii nu mor niciodata "txt"
[type] => TXT
[class] => IN
)
)
)
Transform
Transform to String
$record = newTXT([
'host' => "txt.test.bluelibraries.com",
'ttl' => 3600,
'txt' => "heroes never die - eroii nu mor niciodata \"txt\""
]);
echo'string1 = ' . json_encode($record->toString()) . PHP_EOL;
echo'string2 = ' . json_encode((string)$record) . PHP_EOL;
string1 = "txt.test.bluelibraries.com 3600 IN TXT \"heroes never die - eroii nu mor niciodata \\\"txt\\\"\""
string2 = "txt.test.bluelibraries.com 3600 IN TXT \"heroes never die - eroii nu mor niciodata \\\"txt\\\"\""
Transform to JSON
$record = newTXT([
'host' => "txt.test.bluelibraries.com",
'ttl' => 3600,
'txt' => "heroes never die - eroii nu mor niciodata \"txt\""
]);
echo'JSON = ' . json_encode($record) . PHP_EOL;
JSON = {"host":"txt.test.bluelibraries.com","ttl":3600,"txt":"heroes never die - eroii nu mor niciodata \"txt\"","class":"IN","type":"TXT"}
Transform to Array
$record = newTXT([
'host' => "txt.test.bluelibraries.com",
'ttl' => 3600,
'txt' => "heroes never die - eroii nu mor niciodata \"txt\""
]);
print_r($record->toArray());
Array
(
[host] => txt.test.bluelibraries.com
[ttl] => 3600
[txt] => heroes never die - eroii nu mor niciodata "txt"
[class] => IN
[type] => TXT
)