{"id":365,"date":"2010-08-23T05:46:00","date_gmt":"2010-08-23T09:46:00","guid":{"rendered":"http:\/\/www.searchenginegenie.com\/programming-blog\/?p=365"},"modified":"2012-12-11T02:31:18","modified_gmt":"2012-12-11T06:31:18","slug":"explode-function-in-php","status":"publish","type":"post","link":"https:\/\/www.searchenginegenie.com\/programming-blog\/explode-function-in-php\/","title":{"rendered":"Explode function in php"},"content":{"rendered":"<p>How to split a name using explode function?<br \/>\n1. Get the name in a variable<br \/>\n2. Specify the position from which you need to split the name.<br \/>\n3. If you need to split the name after an underscore, use &#8220;_&#8221;.<br \/>\n4. If you need to split the name after @, use &#8220;@&#8221;.<\/p>\n<p>[php]<\/p>\n<p>&lt;?php<\/p>\n<p>$name\u00a0 = &quot;john_abraham@gmail.com&quot;;<br \/>\n $pieces = explode(&quot;_&quot;, $name);<br \/>\n echo &quot;firstname = $pieces[0]&quot;.&quot;&lt;br \/&gt;&quot;;<\/p>\n<p>$pieces = explode(&quot;@&quot;, $name);<br \/>\n echo &quot;username = $pieces[0]&quot;;<\/p>\n<p>?&gt;<\/p>\n<p>[\/php]<\/p>\n<p>Output will be displayed as:<br \/>\nfirstname = john<br \/>\nusername = john_abraham<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to split a name using explode function? 1. Get the name in a variable 2. Specify the position from which you need to split the name. 3. If you need to split the name after an underscore, use &#8220;_&#8221;. 4. If you need to split the name after @, use &#8220;@&#8221;. [php] &lt;?php $name\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[148],"class_list":["post-365","post","type-post","status-publish","format-standard","hentry","category-php","tag-php-explode-command"],"_links":{"self":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":8,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":635,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/365\/revisions\/635"}],"wp:attachment":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}