Crawler::xpathLiteral()

static string xpathLiteral(string $s)

Converts string for XPath expressions.

Escaped characters are: quotes (") and apostrophe (').

Examples: 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')

Parameters

string $s String to be escaped

Return Value

string Converted string
doc_Symfony
2016-10-28 06:12:38
Comments
Leave a Comment

Please login to continue.