Php knowledge point review strings. these can be hard-coded. remember to look back !!! /* Echo & lt; markqqqqqq \ nqqqqqq & lt; br & gt; qqqqqqqqqqqqqqq \ rqqqqqqqqqqqqq php knowledge point review string
These are all hard work. remember to look back !!!
/* Echo <mark
Qqqqqq \ nqqqqqq
Qqqqqqqqqqqqqqq \ rqqqqqqqqqqqqqqqqqqqqqq
Mark */
// The technical mark should be set to another line and written in the top level!
// Similar ""
// The most fatal point is that a mark cannot be followed by any symbols, that is, it must be used at the end of the code.
$ A = "aaaaaaaaaa ";
$ B = "bbbbbbbbbbbb ";
$ C = print ($ );
Echo"
";
Echo $ c;
Echo"
";
Echo $ a, $ B;
// 5b binary format; % c ASCII format
$ Format = "% B, % c ";
Printf ($ format, 100,200 );
Echo sprintf ($ format, 100,200 );
Echo"
";
$ Str = "abcdefghijklmnopqrstyvwxyz ";
$ Width = 4;
$ Break = "\ t ";
Echo wordwrap ($ str, $ width, $ break, true );
/* Strtoupper ();
Strtolower ();
Ucwords ();*/
// Strlen ()
// The space in the string is also counted as one.
// Use substr_count (string str, string sub, [int start, int length ])
$ Words = "ran zhang li ni ran ";
$ Handle = "ran ";
$ Count = substr_count ($ words, $ handle );
Echo $ count;
// Mixed str_word_count (string $ str, [int format, string $ child]);
// Format 0: default value. The number of returned words.
// 1: returns an array of words. The key is the index value.
// 2: returns an array of words. The key is the position of the first letter of the word.
// Search for substrings
$ A1 = "aaaaaabdddddd ";
$ A2 = "B ";
$ A3 = strstr ($ a1, $ a2 );
Echo $ a3;
// Output bdddddd
// Location search. the returned location is almost the same as above.
// Int strpos (string $ a, string B, [int offset]);
// String replication
Echo"
";
$ Input = "zhangran ";
$ Number = 10;
$ Str = str_repeat ($ input, $ number );
Echo $ str;
// Reverse string
Echo"
";
$ A4 = strrev ("abc ");
Echo $ a4;
// Replace
// Substr_replace (mixed $ string, string $ replacement, int $ start, [int $ length])
// Split
Echo"
";
$ A5 = "hello, world, I, am, the, only, one ";
$ Separator = ",";
$ A7 = 3;
$ Array = explode ($ separator, $ a5, $ a7 );
Print_r ($ array );
Echo"
";
$ A8 = "qqqqqqqqqqqqqqqqqqqq ";
$ A9 = 4;
$ B3 = str_split ($ a8, $ a9 );
Print_r ($ b3 );
// If it cannot be sorted out first
// Merge
Echo"
";
$ B4 = array ("aaa", "bbb", "ccc ");
$ B5 = ",";
Echo implode ($ b5, $ b4 );
// String comparison
// Int strcmp (str1, str2) which is completely compared
// Strncmp (str1, str2, len) checks whether the first len strings of the two strings are equal.