{"id":37320,"date":"2018-04-11T03:01:44","date_gmt":"2018-04-10T17:01:44","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=37320"},"modified":"2018-04-11T07:09:06","modified_gmt":"2018-04-10T21:09:06","slug":"string-delimitation-in-web-applications-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/string-delimitation-in-web-applications-primer-tutorial\/","title":{"rendered":"String Delimitation in Web Applications Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/split_explode.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"String Delimitation in Web Applications Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/split_explode.gif\" title=\"String Delimitation in Web Applications Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">String Delimitation in Web Applications Primer Tutorial<\/p><\/div>\n<p>Web application client and server logic is often based on &#8230;<\/p>\n<ul>\n<li>string manipulations via Javascript (client) and PHP (server, for us) string functions &#8230; and a huge subset of functionality, at least for us, is &#8230;<\/li>\n<li>handling delimitation issues via Javascript <a target=_blank title='Javascript split information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/jsref_split.asp'><i>split<\/i><\/a> and PHP <a target=_blank le='PHP explode method information from php.net' href='http:\/\/php.net\/manual\/en\/function.explode.php'><i>explode<\/i><\/a> methods<\/li>\n<\/ul>\n<p>You could quibble about the syntax differences between Javascript <i>split<\/i> and PHP <i>explode<\/i> methods, but they have the same aim in mind &#8230; they &#8230;<\/p>\n<ul>\n<li>return a Javascript <i>array<\/i> (or Array object) and PHP <i>array<\/i> object respectively &#8230;<\/li>\n<li>have involved in their argument list a &#8220;delimitation&#8221; argument (as the criteria behind how they create that <i>array<\/i>)<\/li>\n<\/ul>\n<p>No rocket science, but if you like to gather little rockets together in a (Javascript (object)) string (of object method calls) or (PHP) nest (of calls), then the potency of these two (string delimitation) methods can become apparent.  Whole jobs can base themselves on delimitation, at least in our books (<font size=1>but definitely not our pamplettes<\/font>) as we would direct you to with <a target=_blank title='Textarea Pointing Local Font Colour Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-colour-tutorial\/'>Textarea Pointing Local Font Colour Tutorial<\/a> where we were inventing the delimitation rules, as well as implementing them.  In such a scenario, would hate to be tasked with the job of counting how many times we&#8217;d have used Javascript <i>split<\/i> (and\/or PHP <i>explode<\/i>) in such a job.   Perhaps the alternative, of thinking that every bit of data should be in a database, and admittedly documented in this way, is more appealing to you as a formal approach, but if you tend to think this way, perhaps you are overengineering, and not using self-explanatory enough var<font size=1>iable<\/font> names to balance the syntax ugliness of &#8220;stringing&#8221; and &#8220;nesting&#8221; with the speed of coding.<\/p>\n<p>And that is what is great for us.  You can delimit away, and the speed of coding using <i>split<\/i> and <i>explode<\/i> means that break for coffee can be achieved earlier.<\/p>\n<p>Let&#8217;s leave you with some worked examples of usage involving &#8230;<\/p>\n<p><code><br \/>\nThe quick brown fox jumps over the lazy dog.  The rain in Spain falls mainly on the plain.  Many hands make light work.<br \/>\n<\/code><\/p>\n<p><iframe style='width:100%;overflow:scroll;height:950px;' src='http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/split_explode.html' title='String delimiters'><\/iframe><\/p>\n<p>You can see us clicking the (Javascript client &#8220;split&#8221; usage) links above in today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/split_explode.pdf\" title=\"Click picture\">PDF slideshow<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d37320' onclick='var dv=document.getElementById(\"d37320\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d37320' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Web application client and server logic is often based on &#8230; string manipulations via Javascript (client) and PHP (server, for us) string functions &#8230; and a huge subset of functionality, at least for us, is &#8230; handling delimitation issues via &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/string-delimitation-in-web-applications-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[103,212,2522,2276,2321,652,2521,849,932,997,1122,2013,1626,1319,1402],"class_list":["post-37320","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-array","tag-client","tag-delimit","tag-delimitation","tag-explode","tag-javascript","tag-nest","tag-object","tag-php","tag-programming","tag-server","tag-split","tag-string","tag-tutorial","tag-web-application"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37320"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=37320"}],"version-history":[{"count":12,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37320\/revisions"}],"predecessor-version":[{"id":37355,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37320\/revisions\/37355"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=37320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=37320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=37320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}