The issue is that the & character in "Bunnies & Burrows" is being interpreted as the start of an XML entity (like &, <, etc.), but "Burrows" isn't a valid XML entity name.
The Fix: XML Escape the Ampersand
In XML, you need to escape the & character as &:
search_term = "Bunnies & Burrows"xml_safe_term = search_term.replace("&", "&")# Result: "Bunnies & Burrows"
Try this and see if it yields any clues:
<?php
$test = "Bunnies & Burrows";
echo "Original: " . $test . "\n";
echo "Escaped: " . htmlspecialchars($test, ENT_XML1, 'UTF-8') . "\n";echo "Manual: " . str_replace('&', '&', $test) . "\n";