{"id":7308,"date":"2019-10-21T06:07:40","date_gmt":"2019-10-21T06:07:40","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=7308"},"modified":"2021-11-16T05:44:43","modified_gmt":"2021-11-16T05:44:43","slug":"deep-dive-into-php-general-types","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/deep-dive-into-php-general-types\/","title":{"rendered":"Deep Dive into PHP General Types"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>History of php<\/strong><\/h3>\n\n\n\n<p>father of php rasmus lerdorf in 1994 version 1.0 in(june).<br>  (that time he was created (CGI) Comment Gateway Interface <br> and written in C )<\/p>\n\n\n\n<p>second version in appril 1996 was released 2.0<br>\n <\/p>\n\n\n\n<p> login Acces Password Protection Create\/Display Forms. <br> form interpetred.<br> and <br> (1)conditional satements  [to hidding the blocks ]<br> (2) Access to datbases and terms scripting language<\/p>\n\n\n\n<p>6th june 1998 php version 3.0  <\/p>\n\n\n\n<p>                 (1) personal Home Page<br>                (2) php Hepertext Preprocessor.<\/p>\n\n\n\n<p><br> PHP 4.0<br> 22th may 2000 new zend Engine version 4.0<\/p>\n\n\n\n<p>PHP 5.0<br>\njuly 2004 Zend engine (2.0) and version 5.0 <br>\nphp 5.5 suported 64-bits builds<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"> Posibility of PHP:- <\/h4>\n\n\n\n<p><br> PHP is a server-side scripting language designed for web development<br> PHP powers everything from blogs to the most popular websites in the world<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Where is PHP used<\/h4>\n\n\n\n<p>The world&#8217;s largest social network, Facebook uses PHP<br>\nThe world&#8217;s largest content management system, WordPress runs on PHP<br>\nMany developers use PHP as a server-side language<br>\nPHP is simple. Hence, many beginners use it.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Why PHP<\/h4>\n\n\n\n<p><br> PHP is secure<br> PHP runs on many operating systems like Windows, Mac OS, Linux, etc.<br> PHP is supported by many servers like Apache, IIS, Lighttpd, etc.<br> PHP supports many database systems like MYSQL, Mango DB, etc.<br> PHP is free<br> The power of PHP<br> PHP can serve dynamic web pages<br> PHP can collect, validate, save form data<br> PHP can add, modify, delete data in the database<br> PHP can handle sessions and cookies<br> PHP can read, write, delete files on the server<br> PHP can serve Images, PDFs, Flash Movies and more file types<br> PHP can resize, compress, edit images<br> About the PHP Language<br> PHP Language is a human-readable programming language which can easily be learned. The below code will output &#8220;Hello World&#8221;<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>echo &#8220;helloworld&#8221;;<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Why Should I Learn PHP?<\/h4>\n\n\n\n<p><br> PHP is beginner-friendly. If you are a beginner, you can understand PHP without much effort.<br> PHP is one of the highest paid programming languages.<\/p>\n\n\n\n<p>lets go for creating simple programs in php <br>\nhow to display the content using php tag:-<\/p>\n\n\n\n<p>how to give comment in php [    double back salesh \/\/  example: \/\/echo &#8220;hello word&#8221;;<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$message=&#8221;hello world&#8221;;<\/p>\n\n\n\n<p>echo $message;<\/p>\n\n\n\n<p>?<\/p>\n\n\n\n<p>example  2<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$meesage=&#8221;hello world&#8221;;<\/p>\n\n\n\n<p>echo $message;<\/p>\n\n\n\n<p>\/\/echo &#8220;hello world&#8221;;  ?&gt;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">        <\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Function<\/h4>\n\n\n\n<p>PHP functions are similar to other programming languages. A function is a piece of code <br>\nwhich takes one more input in the form of parameter and does some processing and<br>\n returns a value.<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/* Defining a\nPHP Function *\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function\nwriteMessage() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo\n&#8220;You are really a nice person, Have a nice time!&#8221;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/* Calling a\nPHP Function *\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nwriteMessage();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?&gt;<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/* Defining a\nPHP Function *\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function display($name1,$name2)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>$name=&#8221;welcome to america&#8221;;<\/p>\n\n\n\n<p>echo &#8220;$name1 to $name2&#8221;;<\/p>\n\n\n\n<p>}  ?&gt;<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>function simplemsg() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; echo &#8220;Hello\nworld!&#8221;;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>simplemsg(); \/\/ call the function<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>function familyName($fname, $year) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; echo &#8220;$fname\nRefsnes. Born in $year &lt;br&gt;&#8221;;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>familyName(&#8220;Hege&#8221;, &#8220;1975&#8221;);<\/p>\n\n\n\n<p>familyName(&#8220;Stale&#8221;, &#8220;1978&#8221;);<\/p>\n\n\n\n<p>familyName(&#8220;Kai Jim&#8221;, &#8220;1983&#8221;);<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"> Strings <\/h4>\n\n\n\n<p>What if you needed to add a single quote inside a single quoted string?<\/p>\n\n\n\n<p>&nbsp;Just escape that\ncharacter with a back slash. \\&#8217;<\/p>\n\n\n\n<p>A string is collection of charactors .string is one of the\ndata types supported by php.<\/p>\n\n\n\n<p>Escape Sequence&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Meaning<\/p>\n\n\n\n<p>\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                             Line Break<\/p>\n\n\n\n<p>\\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                            &nbsp; Carriage Return<\/p>\n\n\n\n<p>\\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                             Tab Space<\/p>\n\n\n\n<p>\\\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                            Backslash<\/p>\n\n\n\n<p>\\$&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                           Dollar Sign<\/p>\n\n\n\n<p>\\&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                           Double Quotes<\/p>\n\n\n\n<p>example 1<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>echo &#8220;hello world&#8221;;<\/p>\n\n\n\n<p>echo&#8221;&lt;br&gt;&#8221;;<\/p>\n\n\n\n<p>echo&#8221;\\&#8221;hello world\\ &#8220;&#8221;;<\/p>\n\n\n\n<p>echo&#8221;\\n\\t hello world\\n&#8221;;<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 2<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$display = &#8220;sam&#8221;;<\/p>\n\n\n\n<p>echo &#8220;My name is $display&#8221;;<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example&nbsp; 3<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$veg = &#8216;Apple&#8217;;<\/p>\n\n\n\n<p>\/\/ echo &#8220;$veg&#8221;; # there&#8217;s no variable $fruits<\/p>\n\n\n\n<p>echo &#8220;{$veg}s&#8221;;<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>Note: Out put data will be show with content with s <\/p>\n\n\n\n<p>as a Apples.<\/p>\n\n\n\n<p>example 4<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>\/\/ both works<\/p>\n\n\n\n<p>echo &#8220;Hello &lt;br&gt;&#8221;;<\/p>\n\n\n\n<p>echo &#8216;Hello &lt;br&gt;&#8217;;<\/p>\n\n\n\n<p>\/\/ escape sequences are not parsed in single quotes<\/p>\n\n\n\n<p>echo &#8220;World&#8221; .&#8221;&lt;br&gt;&#8221;; \/\/ outputs\n&#8220;World&#8221;<\/p>\n\n\n\n<p>echo &#8216;&#8221;World&#8221; &lt;br&gt;&#8217;; \/\/ outputs\n&#8220;World&#8221;<\/p>\n\n\n\n<p>\/\/ variables are not parsed in single quotes<\/p>\n\n\n\n<p>$hello = &#8220;Hello&#8221;;<\/p>\n\n\n\n<p>echo &#8220;$hello World &lt;br&gt;&#8221;; \/\/ outputs Hello\nWorld<\/p>\n\n\n\n<p>echo &#8216;$hello World &lt;br&gt;&#8217;; \/\/ outputs $hello World                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?&gt;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Array <\/h3>\n\n\n\n<p>Note:-<\/p>\n\n\n\n<p>An array stores multiple values in one single variable:<\/p>\n\n\n\n<p>What is an Array?<\/p>\n\n\n\n<p>An array is a special variable, which can hold more than one\nvalue at a time.<\/p>\n\n\n\n<p>A list of items (a list of car names, for example), storing\nthe cars in single variables could look like this:<\/p>\n\n\n\n<p>An array can be declared using the array() function.<\/p>\n\n\n\n<p>An array can be declared wrapped with [ and ].<\/p>\n\n\n\n<p>array are colection of data items store under a single name.<\/p>\n\n\n\n<p>Indexed or Numeric Arrays: <\/p>\n\n\n\n<p>An array with a numeric index where values are stored\nlinearly.<\/p>\n\n\n\n<p>Associative Arrays:<\/p>\n\n\n\n<p>&nbsp;An array with a\nstring index where instead of linear storage, each value can be assigned a\nspecific key.<\/p>\n\n\n\n<p>Multidimensional Arrays:<\/p>\n\n\n\n<p>&nbsp;An array which contains single or multiple array within it and can be accessed via multiple indices.<\/p>\n\n\n\n<p>example 1<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$fee [&#8220;ramu&#8221;]= 500;<\/p>\n\n\n\n<p>echo $fee[&#8220;ramu&#8221;];<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 2<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$fee [&#8220;ramu&#8221;]= 900;<\/p>\n\n\n\n<p>echo &#8220;rahul fee:&#8221;,$fee[&#8220;ramu&#8221;];<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 3<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$fees = array(&#8220;ali&#8221;=&gt;500,\n&#8220;sonu&#8221;=&gt;300 );<\/p>\n\n\n\n<p>echo $fees&nbsp;\n[&#8220;ali&#8221;];<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 4<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>$vegetable = array(&#8220;pumking&#8221;, &#8220;chilli&#8221;,\n&#8220;redish&#8221;);<\/p>\n\n\n\n<p>echo &#8220;I like &#8221; . $vegetable[0] . &#8220;, &#8221; .\n$vegetable[1] . &#8221; and &#8221; . $vegetable[2] . &#8220;.&#8221;;<\/p>\n\n\n\n<p>?&gt; <\/p>\n\n\n\n<p>example 5 <\/p>\n\n\n\n<p>&lt;?php <\/p>\n\n\n\n<p>\/\/ Defining a multidimensional array <\/p>\n\n\n\n<p>$favorites = array( <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; array( <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;name&#8221; =&gt; &#8220;ali&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;mob&#8221; =&gt; &#8220;0000000000&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;email&#8221; =&gt; &#8220;ali@gmail.com&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ), <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; array( <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;name&#8221; =&gt; &#8220;Monty&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;mob&#8221; =&gt; &#8220;00000000000&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;email&#8221; =&gt; &#8220;monty@gmail.com&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ), <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; array( <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;name&#8221; =&gt; &#8220;sammu &#8220;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;mob&#8221; =&gt; &#8220;000000000000&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&#8220;email&#8221; =&gt; &#8220;sammu@gmail.com&#8221;, <\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; ) <\/p>\n\n\n\n<p>); <\/p>\n\n\n\n<p>\/\/ Accessing elements <\/p>\n\n\n\n<p>echo &#8221; email-id is: &#8221; .\n$favorites[0][&#8220;email&#8221;], &#8220;\\n&#8221;; <\/p>\n\n\n\n<p>echo &#8221; mobile number is: &#8221; .\n$favorites[1][&#8220;mob&#8221;];<\/p>\n\n\n\n<p>?&gt; <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Numeric Array<\/h4>\n\n\n\n<p> Arrays can store numbers, strings and any object but their index will be represented by numbers. By default array index starts from zero.<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p>&lt;?php          \/* First method to create array. *\/                                                   $numbers = array( 1, 2, 3, 4, 5);                                                                          foreach( $numbers as $value )   {                                                                           echo &#8220;Value is $value &lt;br \/&gt;&#8221;;          }                                                                            \/* Second method to create array. *\/                                                          $numbers[0] = &#8220;one&#8221;;                                                                                           $numbers[1] = &#8220;two&#8221;;                                                                                                $numbers[2] = &#8220;three&#8221;;                                                                                    $numbers[3] = &#8220;four&#8221;;                                                                                            $numbers[4] = &#8220;five&#8221;;                                                                                         foreach( $numbers as $value )                                                          <\/p>\n\n\n\n<p> {             echo &#8220;Value is $value &lt;br \/&gt;&#8221;;          }       ?&gt;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Class and objects<\/h4>\n\n\n\n<p>   paper-source:0;} div.WordSection1 {page:WordSection1;} &#8211;&gt;  &nbsp;<\/p>\n\n\n\n<p>  Object is class type variable.  the collection of object is called class. <\/p>\n\n\n\n<p> &nbsp;  class:- This is a programmer-defined data type, which includes local functions as well as local data.   &nbsp; <\/p>\n\n\n\n<p>Object &#8211; An individual instance of the data structure defined by a class.  &nbsp;  &nbsp;  Member Variable &#8211; These are the variables defined inside a class.  &nbsp;  &nbsp;  Member function &#8211; These are the function defined inside a class and are used to access object data.  <\/p>\n\n\n\n<p>&lt;?php&nbsp;&nbsp;&nbsp; <\/p>\n\n\n\n<p>class Myclass<\/p>\n\n\n\n<p>{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/p>\n\n\n\n<p>&nbsp;\/\/ Add property\nstatements here<\/p>\n\n\n\n<p>&nbsp;\/\/ Add the methods\nhere<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>$myobj = new MyClass;<\/p>\n\n\n\n<p>var_dump($myobj);<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>Notes:-&nbsp; class\n&#8212;&#8211;class is keyword of php<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Myclass&#8212;&#8211;is class name<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $myobjet&#8211;&nbsp; Here $myobj represents an object of the class\nMyclass.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new&nbsp; :&#8212;&#8212;&#8211;object of Myclass<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_dum&nbsp; : &#8212;&#8212;&#8212;&#8212;here var_dum is a &#8212;&#8212;-function<\/p>\n\n\n\n<p>example 2<\/p>\n\n\n\n<p>&lt;?php&nbsp;&nbsp; <\/p>\n\n\n\n<p>class Myclass<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;public $font_size\n=10;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>$f = new MyClass;<\/p>\n\n\n\n<p>echo $f-&gt;font_size;<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 3<\/p>\n\n\n\n<p>&lt;?php&nbsp;&nbsp; <\/p>\n\n\n\n<p>class Myclass<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;public $font\n=&#8221;18px&#8221;;<\/p>\n\n\n\n<p>&nbsp;public $font_color =\n&#8220;blue&#8221;;<\/p>\n\n\n\n<p>&nbsp;public $string_name =\n&#8220;w3resource&#8221;;<\/p>\n\n\n\n<p>&nbsp;public function\ncustomize_print()<\/p>\n\n\n\n<p>&nbsp;{<\/p>\n\n\n\n<p>&nbsp;echo &#8220;&lt;p\nstyle=font-size:&#8221;.$this-&gt;font_size.&#8221;;color:&#8221;.$this-&gt;font_color.&#8221;;&gt;&#8221;.$this-&gt;string_name.&#8221;&lt;\/p&gt;&#8221;;<\/p>\n\n\n\n<p>&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>$f = new MyClass;<\/p>\n\n\n\n<p>echo $f-&gt;customize_print();<\/p>\n\n\n\n<p>?&gt;<\/p>\n\n\n\n<p>example 4<\/p>\n\n\n\n<p>&lt;?php<\/p>\n\n\n\n<p>&nbsp;class Myclass<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>public $vegetable =&#8221;&#8221;apple;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>$dd =new Myclass;<\/p>\n\n\n\n<p>echo $f-&gt;vegetable;<\/p>\n\n\n\n<p>?><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_98744\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_69715\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_98744\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>History of php father of php rasmus lerdorf in 1994 version 1.0 in(june). (that time he was created (CGI) Comment Gateway Interface and written in C ) second version in appril 1996 was released 2.0 login Acces Password Protection Create\/Display Forms. form interpetred. and (1)conditional satements [to hidding the blocks ] (2) Access to datbases&#8230;<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[5150],"tags":[490,5434,5431,5435,466],"class_list":["post-7308","post","type-post","status-publish","format-standard","hentry","category-php","tag-array","tag-class","tag-function","tag-objects","tag-string"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=7308"}],"version-history":[{"count":6,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7308\/revisions"}],"predecessor-version":[{"id":25371,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7308\/revisions\/25371"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=7308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=7308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=7308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}