Is there a specific best practice for handling identifiers like id in XPath queries in PHP?

When handling identifiers like id in XPath queries in PHP, it is recommended to use the concat() function to concatenate the variable containing the id value within the XPath query. This helps prevent syntax errors and ensures that the id is properly inserted into the query.

$id = "example_id";
$query = "//div[@id='" . $id . "']";