0% found this document useful (0 votes)
31 views3 pages

Divided Imageggssmm

Hdhdj whjw quidh gdgbe e eehhe hrhh

Uploaded by

Gaurav kolhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Divided Imageggssmm

Hdhdj whjw quidh gdgbe e eehhe hrhh

Uploaded by

Gaurav kolhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
Sure, here's a brief explanation of each string processing function in PHP with simple definitions ant examples: 1. chr) + Definition: Converts an ASCII cade into its corresponding character. = Syntax: “chr($asei1_ code)” * Example: echo chr¢es}, f/ Gutput: A 2. ordi) « Definition: Returns the ASCII value of the first character of a string, = Syntax: “ord¢schary’ + Example: echo ora("A'); ¢/ Output: &5 3, strlen() = Definition: Returns the length of a string. « Syntax: “strlen($string?” « Example: “§str = "Hello"; echo strlen($str); // Output: 5 4, trim() + Definition: Removes whitespace (or other characters) from the beginning and end of a string, = Syntax: “trin(sscring, $charlisty® * Example: “fstr =" Hello *; echo trim($str}; ¢/ Output: “Helio” 5, Itrim) + Definition: Removes whitespace (ar other characters} fromthe beginning of a string. + Syntax: “Ltrim(#string, schar List)” s Example: $etr = " Helle *; echo lerin($str); // Output: *Helle *” 6 rtrimp) + Syntax: + Example: “gare = ["apale, “banana”, "cherry": echo joini", ", join¢sglue, tarray)* fare}; ¢¢ Qutaut: “apple, banana, cherry*’ 8, substr{) « Definition Returns part of a string. * Syntax: “substr(§string, $start, Slength) + Example: fstr = "Hello, worddl!*; echo subsercsstr, 8) 5); é Qutput: "Mella" 9. strreplece() « Definition: Replaces all occurrences of a search string with a replacement string. * Syntax: “str_replace($search, 3replace, $string)” « Example: ¢str = "Hello, Worlol*; echo str_replace( "World", "PHP", dete}; /* Gutgut: "Hello, BHP! 10, strsplit() * Definition: Splits a string into an array of characters. = Syntax: “str_split(sstring, #split_length)* + Example: “fstr = "Hello": print_r(str_split(stey3; ¢/ Output: Array € (0) *= [1] e+ @ (2) 92 2 (3) <1 [a] ay 11. str_word_count() « Definition: Counts the number of words in a string. = Syntax: “str_word_count( $string, $fermat, ScharList) + Example: “tstr = “Hello, World!*; echo str_word_count($stry: f¢ Output: 2 12. strempi) + Definition: Compares two strings « Example: §str1 = "hello"; §str2 = "Wella"; echo streasecmpi($str’, $str2u; #/ Output: O° 14, sirpos() + Definition: Finds the positian of the first occurrence of a substring ina string, = Syntax: “strpos($haystack, Sneedle, Soffsety’ « Example: “fstr = "Hello, World! Gutput: 7 echa strpas(sstr, "Morld"}; #7 15. stripos{) + Definition: Cascinsensitive version of strpas¢)’. + Syntax; “stripos(thaystack, fneedle, Soffset)* = Example: fstr = "Hello, World!"; echo stripos($str, ‘worka"); 47 cutput: 7 16, strrevi() * Definition: Reverses a string. + Syntax: “secre (#steing? + Example: fstr = "Hello"; echo strrevéfser): é/ Output: “olleH" 17. strtolowerf) * Definition: Converts a string to lowercase. + Syntax; “strtolonercsstring)’ = Example: “fstr = "Hello"; echo strtolower(sstr); ¢f Gutput; “hello 16. strtoupper() + Definition: Converts a string 10 uppercase, = Syntax: scrtoupper (string) + Example: “fstr = "Hello": echo streoupper(tstr): ¢/ Gutput:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy