Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が試したコード:
$var = '<a href="hellow"> Test </a>'; // Convert " to ' echo preg_replace('/<([^<>]+)>/e', '"<" . str_replace(\'"\', "\'", "$1") . ">"', $var);
echo preg_replace_callback( '/<([^<>]+)>/', function($m) { return str_replace('"', "'", $m[0]); }, $var);