{"id":318,"date":"2018-01-11T09:38:00","date_gmt":"2018-01-11T09:38:00","guid":{"rendered":"http:\/\/mddir.com\/how-to\/?p=318"},"modified":"2018-01-11T09:38:00","modified_gmt":"2018-01-11T09:38:00","slug":"php-function-arguments","status":"publish","type":"post","link":"https:\/\/www.mddir.com\/how-to\/php-function-arguments\/","title":{"rendered":"PHP Function Arguments"},"content":{"rendered":"<p>The php function arguments are similar to a variable. You have to define it in the function name to get the output.<\/p>\n<p>Example<\/p>\n<p>[php]&lt;?php<br \/>\nfunction familyName($fname , $lname) {<br \/>\n    echo &quot;$fname $lname.&lt;br&gt;&quot;;<br \/>\n}<\/p>\n<p>familyName(&quot;Jani&quot;, &quot;jget&quot;);<br \/>\nfamilyName(&quot;Hege&quot; , &quot;jget&quot;);<br \/>\nfamilyName(&quot;Stale&quot; , &quot;jget&quot;);<br \/>\nfamilyName(&quot;Kai Jim&quot; , &quot;jget&quot;);<br \/>\nfamilyName(&quot;Borge&quot; , &quot;jget&quot;);<br \/>\n?&gt;[\/php]<\/p>\n<p>In the above code, we have declared a function. The function has function name &#8220;<code>familyName<\/code>&#8220;. The function name has two arguments <code>$fname<\/code> and <code>$lname<\/code>. On the next line in the curly bracket, we have to ask php script to echo the statement containing the &#8220;<code>$fname<\/code>&#8221; value and &#8220;<code>$lname<\/code>&#8221; value. <\/p>\n<p>After closing the curly bracket we have mentioned the value of the variables in the function statement. Each function name statement has a value of the first name and last name. This information is an echo in the function statement when running in the browser.<\/p>\n<p>You will get the following result from the above script.<\/p>\n<p><code>Jani jget.<br \/>\nHege jget.<br \/>\nStale jget.<br \/>\nKai Jim jget.<br \/>\nBorge jget.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The php function arguments are similar to a variable. You have to define it in the function name to get the output. Example [php]&lt;?php function<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":2,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/318\/revisions\/320"}],"wp:attachment":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}