original_string: public static function quoteXpathValue($string)
      {
          if (strpos($string, "'") === false) {
              return "'$string'";
          }
  
          if (strpos($string, '"') === false) {
              return '"' . $string . '"';
          }
  
          // String contains ' and " -> need to use concat ...
          $parts = explode("'", $string);
          $quoted = implode('\', "\'", \'', $parts);
  
          return "concat('$quoted')";
      }
code: public static function quoteXpathValue($string)
      {
          if (strpos($string, "'") === false) {
              return "'$string'";
          }
  
          if (strpos($string, '"') === false) {
              return '"' . $string . '"';
          }
  
          // String contains ' and " -> need to use concat ...
          $parts = explode("'", $string);
          $quoted = implode('\', "\'", \'', $parts);
  
          return "concat('$quoted')";
      }
code_tokens: public static function quoteXpathValue ( $ string ) { if ( strpos ( $ string , "'" ) === false ) { return "'$string'" ; } if ( strpos ( $ string , '"' ) === false ) { return '"' . $ string . '"' ; } // String contains ' and " -> need to use concat ... $ parts = explode ( "'" , $ string ) ; $ quoted = implode ( '\', "\'", \'' , $ parts ) ; return "concat('$quoted')" ; }
docstring: Quote the given value for an xpath expression
  
  This will also automatically enclose the string
  
  @param string $string
  @return string
docstring_tokens: Quote the given value for an xpath expression