PHP 's four marker styles
1.XML Style
<?php
echo "XML style ";
?>
2. Script Style
<scriptlanguage= "PHP" >
echo ' scripting style ';
</script>
3. Short style
<?echo ' short style ';? >
4.ASP Style
<%
Echo ' ASP style ';
%>
PHP three style of annotation
1. Single-line comment //
2.Multiline Comment /*...*/ ( nested operation not allowed )
3.Shell style Comment #
single and double quotation marks differences in PHP
Single quotes: What you see is what you get
double quotes: content can be interpreted and replaced
<?php
$test = "PHP";
$str = "I like $test";
$str 1= ' I like $test ';
Echo $str;
echo $str 1;
?>
The result is
ILike PHP
ILike $test
PHP string Interception Considerations
When the substr () function intercepts a Chinese string, if an odd number occurs in the truncated string, it may cause the intercepted characters to be garbled because a Chinese character consists of two bytes.
PHP Comparison String
1. String comparisons by Byte
strcmp () case-sensitive
STRCASECMP () is case insensitive
equals is returned 0
2, natural sorting method for string comparison
STRNATCMP () returns equal to 0; Case Sensitive
STRNATCASECMP () is case insensitive
3, specify the location from the source string to start the comparison
STRNCMP () case-sensitive
This article from "11911385" blog, declined reprint!
PHP Learning Small Notes