Symfony\Component\DomCrawler\Crawler::xpathLiteral
Converts string for XPath expressions.
Escaped characters are: quotes (") and apostrophe ('). Examples: <code> echo Crawler::xpathLiteral('foo " bar'); //prints 'foo " bar' echo Crawler::xpathLiteral("foo ' bar"); //prints "foo ' bar" echo Crawler::xpathLiteral('a\'b"c'); //prints concat('a', "'", 'b"c') </code>
Signature
public function xpathLiteral(string
$s )
Parameters
$s
— string- String to be escaped
Returns
- string
- Converted string