I have a multi-line string that I’m trying to extract, but it is not returning any pieces.
$input = '<script>
buffy = 1;
vampire = {
response: [{"sleep":"night"}]
};
</script>';
preg_match( '~response:(.*?)};~', $input, $output );
print_r( $output );
I am trying to extract [{"sleep":"night"}]
2
Answers
check this out :