print the contents of PHP variable as text string in HTML

后端 未结 5 1959
旧时难觅i
旧时难觅i 2021-01-21 21:23

in a wordpress php script, I have the following:

echo \'
\' . $slide_media . \'
\' . \
5条回答
  •  花落未央
    2021-01-21 22:05

    I would do:

    echo '
    ' . var_export($slide_media, true) . '
    ';

    Or maybe

    echo '
    ' . var_export(array_map('htmlentities', $slide_media), true) . '
    ';

    If $slidemedia is an array with html content.

提交回复
热议问题