{"id":70093,"date":"2021-08-25T04:10:06","date_gmt":"2021-08-25T08:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/php-string-related-built-in-functions-16\/"},"modified":"2021-08-25T04:10:06","modified_gmt":"2021-08-25T08:10:06","slug":"php-string-related-built-in-functions-16","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70093","title":{"rendered":"PHP String Related Built in Functions #16"},"content":{"rendered":"<p>Check the following string manipulation related functions in PHP. String manipulation is pretty common in Software Development (esp. in high level, even in low level applications say you are working with network protocols &#8211; you need to interpret\/parse the protocol language). Memorizing library functions is always a good thing &#8211; it&#8217;s a matter of productivity. However, knowing more functions does not guarantee that you will be able to solve a programming problem. However, if you are good at solving problems in general (in programming in general), knowing functions will improve your productivity (may also help to maintain\/improve quality of software indirectly).<\/p>\n<p>You will find many string related functions very useful such as:<\/p>\n<ul>\n<li>trim, rtrim, ltrip, chop, and similar: You may use these functions on user inputs, on data from databases, on data to insert into databases, while comparing two strings.<\/li>\n<li>Wordwrap: To wrap words to create consistent user interfaces<\/li>\n<li>substr_ compare, substr_ count, substr_ replace, substr, strstr, strchr: You will find these functions very usefull. Mostly substring related.<\/li>\n<li>htmlspecialchars, addslashes, stripslashes, stripcslashes, html_ entity_ decode, htmlentities, htmlspecialchars_ decode,htmlspecialchars: For storing\/retrieving HTML data into\/from databases.<\/li>\n<li>echo, print, fprintf, sprintf, vprintf, vfprintf: To output string. Formatted, non-formatted.<\/li>\n<li>strtok, split, implode, explode, chunk_split : These are for dividing and merging strings.<\/li>\n<li>money_format, number_format: To output string in money or number format.<\/li>\n<li>strnatcasecmp, strnatcmp, strncasecmp, strncmp, similar_text : String comparison related functions.<\/li>\n<li>strtolower, strtoupper, ucfirst, ucwords, lcfirst: the names tell it all. Case conversion related.<\/li>\n<li>md5_ file, md5, sha1_ file, sha1, crc32, crypt: encryption &amp; related<\/li>\n<li>sscanf: formatted input<\/li>\n<\/ul>\n<ul>\n<li>addcslashes<\/li>\n<li>addslashes<\/li>\n<li>bin2hex<\/li>\n<li>chop<\/li>\n<li>chr<\/li>\n<li>chunk_ split<\/li>\n<li>convert_ cyr_ string<\/li>\n<li>convert_ uudecode<\/li>\n<li>convert_ uuencode<\/li>\n<li>count_ chars<\/li>\n<li>crc32<\/li>\n<li>crypt<\/li>\n<li>echo<\/li>\n<li>explode<\/li>\n<li>fprintf<\/li>\n<li>get_ html_ translation_ table<\/li>\n<li>hebrev<\/li>\n<li>hebrevc<\/li>\n<li>html_ entity_ decode<\/li>\n<li>htmlentities<\/li>\n<li>htmlspecialchars_ decode<\/li>\n<li>htmlspecialchars<\/li>\n<li>implode<\/li>\n<li>join<\/li>\n<li>lcfirst<\/li>\n<li>levenshtein<\/li>\n<li>localeconv<\/li>\n<li>ltrim<\/li>\n<li>md5_ file<\/li>\n<li>md5<\/li>\n<li>metaphone<\/li>\n<li>money_ format<\/li>\n<li>nl_ langinfo<\/li>\n<li>nl2br<\/li>\n<li>number_ format<\/li>\n<li>ord<\/li>\n<li>parse_ str<\/li>\n<li>print<\/li>\n<li>printf<\/li>\n<li>quoted_ printable_ decode<\/li>\n<li>quoted_ printable_ encode<\/li>\n<li>quotemeta<\/li>\n<li>rtrim<\/li>\n<li>setlocale<\/li>\n<li>sha1_ file<\/li>\n<li>sha1<\/li>\n<li>similar_ text<\/li>\n<li>soundex<\/li>\n<li>sprintf<\/li>\n<li>sscanf<\/li>\n<li>str_ getcsv<\/li>\n<li>str_ ireplace<\/li>\n<li>str_ pad<\/li>\n<li>str_ repeat<\/li>\n<li>str_ replace<\/li>\n<li>str_ rot13<\/li>\n<li>str_ shuffle<\/li>\n<li>str_ split<\/li>\n<li>str_ word_ count<\/li>\n<li>strcasecmp<\/li>\n<li>strchr<\/li>\n<li>strcmp<\/li>\n<li>strcoll<\/li>\n<li>strcspn<\/li>\n<li>strip_ tags<\/li>\n<li>stripcslashes<\/li>\n<li>stripos<\/li>\n<li>stripslashes<\/li>\n<li>stristr<\/li>\n<li>strlen<\/li>\n<li>strnatcasecmp<\/li>\n<li>strnatcmp<\/li>\n<li>strncasecmp<\/li>\n<li>strncmp<\/li>\n<li>strpbrk<\/li>\n<li>strpos<\/li>\n<li>strrchr<\/li>\n<li>strrev<\/li>\n<li>strripos<\/li>\n<li>strrpos<\/li>\n<li>strspn<\/li>\n<li>strstr<\/li>\n<li>strtok<\/li>\n<li>strtolower<\/li>\n<li>strtoupper<\/li>\n<li>strtr<\/li>\n<li>substr_ compare<\/li>\n<li>substr_ count<\/li>\n<li>substr_ replace<\/li>\n<li>substr<\/li>\n<li>trim<\/li>\n<li>ucfirst<\/li>\n<li>ucwords<\/li>\n<li>vfprintf<\/li>\n<li>vprintf<\/li>\n<li>vsprintf<\/li>\n<li>wordwrap<\/li>\n<\/ul>\n<p>From: http:\/\/sitestree.com\/?p=5261<br \/> Categories:16<br \/>Tags:<br \/> Post Data:2006-08-01 21:49:26<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check the following string manipulation related functions in PHP. String manipulation is pretty common in Software Development (esp. in high level, even in low level applications say you are working with network protocols &#8211; you need to interpret\/parse the protocol language). Memorizing library functions is always a good thing &#8211; it&#8217;s a matter of productivity. &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70093\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-70093","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":70063,"url":"http:\/\/bangla.sitestree.com\/?p=70063","url_meta":{"origin":70093,"position":0},"title":"Cheat Sheets for Better Productivity #16","author":"Author-Check- Article-or-Video","date":"August 24, 2021","format":false,"excerpt":"Cheat sheets can increase productivity in programming. How?In a cheat sheet, you can write down different functions [with parameters and syntax] that you use frequently [or all the important functions of a programming language]. Whenever, you are confused, take a quick look at the cheat sheets. Sometimes it can be\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70097,"url":"http:\/\/bangla.sitestree.com\/?p=70097","url_meta":{"origin":70093,"position":1},"title":"PHP Network Programming Related Functions #16","author":"Author-Check- Article-or-Video","date":"August 25, 2021","format":false,"excerpt":"What can you do with them? For example 1. Asterisk (http:\/\/www.asterisk.org\/) is a telephony\/telecommunication\/PBX system management software - itr must be using many of these functions. An ISP (like shaw, mts) may write applications to monitor your modem\/router activities, your bandwidth, or the activities in the wireless access points -\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68498,"url":"http:\/\/bangla.sitestree.com\/?p=68498","url_meta":{"origin":70093,"position":2},"title":"PHP Topics and Learning Resources #84","author":"Author-Check- Article-or-Video","date":"August 4, 2021","format":false,"excerpt":"Basic syntax Data Types PHP Variables PHP Constants Language Expressions Operators Control Structures Functions Classes and Objects (PHP 4) Classes and Objects in PHP 5 Namespace in PHP Exceptions in PHP References Predefined variabled Predefined Exceptions Predefined Interfaces Context Options and Parameters Five Common PHP Design Patterns Develop Rock Solid\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70087,"url":"http:\/\/bangla.sitestree.com\/?p=70087","url_meta":{"origin":70093,"position":3},"title":"PHP Functions for SQL Server #16","author":"Author-Check- Article-or-Video","date":"August 25, 2021","format":false,"excerpt":"The name of the functions may closely resemble the functionality.# mssql_ bind # mssql_ close # mssql_ connect# mssql_ data_ seek# mssql_ execute# mssql_ fetch_ array# mssql_ fetch_ assoc# mssql_ fetch_ batch# mssql_ fetch_ field# mssql_ fetch_ object# mssql_ fetch_ row# mssql_ field_ length# mssql_ field_ name# mssql_ field_ seek#\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24412,"url":"http:\/\/bangla.sitestree.com\/?p=24412","url_meta":{"origin":70093,"position":4},"title":"Good Coding Style in PHP + Other languages #Root","author":"Author-Check- Article-or-Video","date":"April 8, 2021","format":false,"excerpt":"Style 1.1: Use proper indenting while ($x < $z) { if ($a == 1) { echo 'A was equal to 1'; } else { if ($b == 2) { \/\/do something } else { \/\/do something else } } } \u00a0 1.2 while ($x < $z) { if ($a ==\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70111,"url":"http:\/\/bangla.sitestree.com\/?p=70111","url_meta":{"origin":70093,"position":5},"title":"Good Coding Style in PHP + Other languages #15","author":"Author-Check- Article-or-Video","date":"August 26, 2021","format":false,"excerpt":"Style 1.1: Use proper indentingwhile ($x < $z) { if ($a == 1) { echo 'A was equal to 1'; } else { if ($b == 2) { \/\/do something } else { \/\/do something else } }}1.2while ($x < $z) { if ($a == 1) { echo 'A was\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70093"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70093\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70093"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}