- var_dump: documentation ( source)
- json_decode: documentation ( source)
- str_replace: documentation ( source)
<?php
$json = '{
"Parameter1":"<style>
#label-9 {
display: block;
text-align: left;
color: #fff;
}
</style>",
"HistoryPosition":"1"
}';
// remove the newlines and replace them with the literal JS newline
$clean = str_replace(["\r", "\n"], ['', ''], $json);
var_dump(json_decode($clean));