I am using the following function as suggested by a friend here to get the innerHTML. While the function works fine and solves my purpose, it is showing syntax error in my IDE. I am not an expert in coding hence not able to figure out. Requesting help in correcting the code.
My code:
<?php
$body = $doc->getElementsByTagName('body')->item(0);
$content = implode(
"",
array_map([$doc, 'saveHTML'], iterator_to_array($body->childNodes))
);
echo $content;
My IDE is showing error on this line array_map([$doc, 'saveHTML'], iterator_to_array($body->childNodes))
UPDATE
I use Adome Dreamweaver CS6 as my code editor.