PHP-Code:
$var1 = 'Singlequoted';
$var2 = "doublequoted";
PHP-Code:
functionDieIchNichtKenne(var1 ); // result: single
PHP-Code:
functionDieIchNichtKenne(var2 ); // result: double
$var1 = 'Singlequoted';
$var2 = "doublequoted";
functionDieIchNichtKenne(var1 ); // result: single
functionDieIchNichtKenne(var2 ); // result: double
$string1 = 'String delimited by singlequotes';
$string2 = "String delimited by singlequotes";
function get_string_delim_type($string)
{
switch ($string[0])
{
case '\\'':
return 'singlequote';
case '"':
return 'doublequote';
}
}
echo get_string_delim_type($string1); // -> ´singlequoted´
echo get_string_delim_type($string2); // -> ´doublequoted´
Kommentar