{"id":1384,"date":"2015-04-21T20:48:41","date_gmt":"2015-04-21T20:48:41","guid":{"rendered":"http:\/\/tutorialsclass.com\/faq\/what-are-the-different-types-of-php-variables"},"modified":"2020-04-23T03:55:06","modified_gmt":"2020-04-23T03:55:06","slug":"php-different-variable-data-types","status":"publish","type":"faq","link":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/","title":{"rendered":"What are the different data types in PHP?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">PHP data type is an attribute that tells about the type of data needs to be stored. There are 8 data types in PHP:<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Integers:<\/strong> are whole numbers, without a decimal point, like 2567<\/li><li><strong>Doubles:<\/strong> are floating-point numbers, like 1.5 or 134.153<\/li><li><strong>Booleans:<\/strong> have only two possible values either true or false<\/li><li><strong>NULL:<\/strong> is a special type that only has one value: NULL<\/li><li><strong>Strings:<\/strong> is a sequence of characters, like &#8220;Hello PHP!&#8221;<\/li><li><strong>Arrays:<\/strong> stores multiple values in one single variable<\/li><li><strong>Objects: <\/strong> instances of user-defined classes<\/li><li><strong>Resources:<\/strong> are special variables that hold references to resources such as database calls<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>PHP data type is an attribute that tells about the type of data needs to be stored. There are 8 data types in PHP: Integers: are whole numbers, without a decimal point,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"faq_type":[122,101],"keywords":[66,113],"class_list":["post-1384","faq","type-faq","status-publish","hentry","faq_type-all-php-interview-questions-answers","faq_type-php-string-interview-questions-answers","keywords-php-data-types","keywords-php-variables"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are the different data types in PHP? - FAQs - Tutorials Class<\/title>\n<meta name=\"description\" content=\"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the different data types in PHP? - FAQs - Tutorials Class\" \/>\n<meta property=\"og:description\" content=\"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorials Class\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tutorialsclass\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-23T03:55:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/07\/tutorials-class-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@TutorialsClass\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/\",\"url\":\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/\",\"name\":\"What are the different data types in PHP? - FAQs - Tutorials Class\",\"isPartOf\":{\"@id\":\"https:\/\/tutorialsclass.com\/#website\"},\"datePublished\":\"2015-04-21T20:48:41+00:00\",\"dateModified\":\"2020-04-23T03:55:06+00:00\",\"description\":\"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorialsclass.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FAQs\",\"item\":\"https:\/\/tutorialsclass.com\/faq\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Career\",\"item\":\"https:\/\/tutorialsclass.com\/articles\/career\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"What are the different data types in PHP?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorialsclass.com\/#website\",\"url\":\"https:\/\/tutorialsclass.com\/\",\"name\":\"Tutorials Class\",\"description\":\"Online Tutorials for Beginners\",\"publisher\":{\"@id\":\"https:\/\/tutorialsclass.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorialsclass.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/tutorialsclass.com\/#organization\",\"name\":\"Tutorials Class\",\"url\":\"https:\/\/tutorialsclass.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png\",\"contentUrl\":\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png\",\"width\":442,\"height\":94,\"caption\":\"Tutorials Class\"},\"image\":{\"@id\":\"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tutorialsclass\",\"https:\/\/x.com\/TutorialsClass\",\"https:\/\/in.pinterest.com\/merientinfotech\/boards\/\",\"https:\/\/www.youtube.com\/channel\/UCzbpQXlqec-bQf1_kwrTuoA\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the different data types in PHP? - FAQs - Tutorials Class","description":"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/","og_locale":"en_US","og_type":"article","og_title":"What are the different data types in PHP? - FAQs - Tutorials Class","og_description":"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.","og_url":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/","og_site_name":"Tutorials Class","article_publisher":"https:\/\/www.facebook.com\/tutorialsclass","article_modified_time":"2020-04-23T03:55:06+00:00","og_image":[{"width":600,"height":600,"url":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/07\/tutorials-class-logo.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@TutorialsClass","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/","url":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/","name":"What are the different data types in PHP? - FAQs - Tutorials Class","isPartOf":{"@id":"https:\/\/tutorialsclass.com\/#website"},"datePublished":"2015-04-21T20:48:41+00:00","dateModified":"2020-04-23T03:55:06+00:00","description":"What are different data types in PHP? A data type tells what type of data needs to be stored. See Example all data types of PHP here.","breadcrumb":{"@id":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tutorialsclass.com\/faq\/php-different-variable-data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorialsclass.com\/"},{"@type":"ListItem","position":2,"name":"FAQs","item":"https:\/\/tutorialsclass.com\/faq\/"},{"@type":"ListItem","position":3,"name":"Career","item":"https:\/\/tutorialsclass.com\/articles\/career\/"},{"@type":"ListItem","position":4,"name":"What are the different data types in PHP?"}]},{"@type":"WebSite","@id":"https:\/\/tutorialsclass.com\/#website","url":"https:\/\/tutorialsclass.com\/","name":"Tutorials Class","description":"Online Tutorials for Beginners","publisher":{"@id":"https:\/\/tutorialsclass.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorialsclass.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tutorialsclass.com\/#organization","name":"Tutorials Class","url":"https:\/\/tutorialsclass.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/","url":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png","contentUrl":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png","width":442,"height":94,"caption":"Tutorials Class"},"image":{"@id":"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tutorialsclass","https:\/\/x.com\/TutorialsClass","https:\/\/in.pinterest.com\/merientinfotech\/boards\/","https:\/\/www.youtube.com\/channel\/UCzbpQXlqec-bQf1_kwrTuoA"]}]}},"_links":{"self":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/faq\/1384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/comments?post=1384"}],"version-history":[{"count":2,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/faq\/1384\/revisions"}],"predecessor-version":[{"id":5165,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/faq\/1384\/revisions\/5165"}],"wp:attachment":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/media?parent=1384"}],"wp:term":[{"taxonomy":"faq_type","embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/faq_type?post=1384"},{"taxonomy":"keywords","embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/keywords?post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}