{"id":1,"date":"2018-10-04T11:47:04","date_gmt":"2018-10-04T08:47:04","guid":{"rendered":"http:\/\/www.etemkeskin.com\/?p=1"},"modified":"2020-11-15T22:29:28","modified_gmt":"2020-11-15T19:29:28","slug":"most-used-build-in-functions-in-php","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/","title":{"rendered":"Most Used Build-in Functions in PHP"},"content":{"rendered":"<p><strong>1.) array() ;<\/strong> is used to create an array.<\/p>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$arr1=array(1,2,3,4,5);\u00a0 \/\/created an array with 5 elements.\n$arr2=array();\u00a0 \u00a0        \/\/created an empty array.\n$arr3= array(\"name\"=>\"bill\", \"surname\"=>\"green\", number=>45);      \/\/created an array with key, value pair .<\/pre>\n\n\n\n<p><strong>2.)<\/strong> <strong>count() <\/strong>  : Returns the number of elements in array<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cars=array(\"apple\",\"pear\",\"quince\");\necho count($cars);    \/\/return 3 as an output.<\/pre>\n\n\n\n<p><strong>3.) isset() :<\/strong> return <strong>True<\/strong> if the variable has been defined and a value assigned or return <strong>False<\/strong> if the variable is not defined.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$mail = $_POST['mail'];    \/\/If the html form is not posted it gets NULL value\nif (isset($mail)){\n    echo \"The mail was posted\";\n}else{\n    echo \"The mail was not posted\";\n}<\/pre>\n\n\n\n<p><strong>4.) is_array():\u00a0<\/strong>Checks whether the variable is an array. Returns a Boolean value.<\/p>\n\n\n\n<p>isset($variable)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$deg = array(\"a\",\"b\",\"c\");\nis_array($deg);        \/\/ return True as output.<\/pre>\n\n\n\n<p><strong>5.) substr(<\/strong><em>string,start,length<\/em> <strong>):\u00a0\u00a0<\/strong>It is used to return any number of characters in a string.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo substr(\"Hello world\",3)   \/\/ Counting from 0, it returns \"lo world\" as output.\necho substr(\"Hello world\",1,7);  \/\/ If we count from 0, it returns 8 characters \"lo worl\" as output.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.) array() ; is used to create an array. 2.) count() : Returns the number of elements in array 3.) isset() : return True if the variable has been defined and a value assigned or return False if the variable is not defined. 4.) is_array():\u00a0Checks whether the variable is an array. Returns a Boolean value. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Most Used Build-in Functions in PHP - blog website<\/title>\n<meta name=\"description\" content=\"Most Used Build-in Functions in PHP\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Most Used Build-in Functions in PHP - blog website\" \/>\n<meta property=\"og:description\" content=\"Most Used Build-in Functions in PHP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-04T08:47:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-15T19:29:28+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.etemkeskin.com\/#website\",\"url\":\"https:\/\/www.etemkeskin.com\/\",\"name\":\"blog website\",\"description\":\"Etem KESK\\u0130N\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.etemkeskin.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/\",\"name\":\"Most Used Build-in Functions in PHP - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"datePublished\":\"2018-10-04T08:47:04+00:00\",\"dateModified\":\"2020-11-15T19:29:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"description\":\"Most Used Build-in Functions in PHP\",\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2018\/10\/04\/most-used-build-in-functions-in-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Most Used Build-in Functions in PHP\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\",\"name\":\"etemkeskin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/#personlogo\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"caption\":\"etemkeskin\"},\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/author\/etemkeskinyahoo-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":25,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":467,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/467"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}