{"id":139,"date":"2016-07-06T13:18:34","date_gmt":"2016-07-06T13:18:34","guid":{"rendered":"https:\/\/barkhane.com\/php\/2016\/07\/06\/understanding-php-data-type\/"},"modified":"2024-03-03T15:05:08","modified_gmt":"2024-03-03T15:05:08","slug":"understanding-php-data-type","status":"publish","type":"post","link":"https:\/\/barkhane.com\/php\/understanding-php-data-type\/","title":{"rendered":"Understanding PHP data type"},"content":{"rendered":"<blockquote>\n<h2>What are Data Types in PHP ?<\/h2>\n<p>A<b>\u00a0data type<\/b> \u00a0is a classification identifying one of various types of data, such as real, integer or Boolean, that determines the possible values for that type, the operations that can be done on values of that type, the meaning of the data, and the way values of that type can be stored in other words\u00a0A particular kind of data item, as defined by the values it can take, the programming language used, or the operations that can be performed on it. Likewise all other language <a href=\"https:\/\/barkhane.com\/php\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">PHP <\/a>also have data types.<\/p><\/blockquote>\n<h2>Data Type in <a href=\"https:\/\/barkhane.com\/php\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">PHP<\/a>.<\/h2>\n<ol>\n<li>Data type in <a href=\"https:\/\/barkhane.com\/php\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">PHP <\/a>are of <strong>intrinsic<\/strong>. It means <strong>no explicit declaration is need<\/strong> for the variable in <a href=\"https:\/\/barkhane.com\/php\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">PHP <\/a>.<\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/php-variable-deceleration\/\" target=\"_blank\" rel=\"noopener\">Variable <\/a>name must have a prefix \\&#8221;<strong>$<\/strong>\\&#8221;(dollar sign ) .<\/li>\n<li><a href=\"https:\/\/barkhane.com\/php\/php-variable-deceleration\/\" target=\"_blank\" rel=\"noopener\">Variable <\/a>name must follow rules for an identifier and <strong>should not start with Number<\/strong>.<\/li>\n<li>Use \\&#8217;<strong>\\\\<\/strong>\\&#8217;as prefix to variable name to skip it from being <a href=\"https:\/\/barkhane.com\/php\/interpolation\/\" target=\"_blank\" rel=\"noopener\">interpolated<\/a>. <strong>\\&#8217;\\\\\\&#8217;<\/strong> is called\u00a0Escape sequence.<\/li>\n<li>To know the Type of data type \u00a0gettype function can be used .<br \/>\neg. gettype(variable); \/\/\/ it returns the data type of variable<\/li>\n<li>We Can have\u00a0double and single quotes \u00a0string in <a href=\"https:\/\/barkhane.com\/php\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">PHP<\/a>.<\/li>\n<li>Single quote string does not contain <a href=\"https:\/\/barkhane.com\/php\/interpolation\/\" target=\"_blank\" rel=\"noopener\">interpolation<\/a><\/li>\n<li>PHP support following type of Data Types\n<ul>\n<li>String<\/li>\n<li>Integer<\/li>\n<li>Float (floating point numbers &#8211; also called double)<\/li>\n<li>Boolean<\/li>\n<li>Array<\/li>\n<li>Object<\/li>\n<li>NULL<\/li>\n<li>Resource<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>What are Data Types in PHP ? A\u00a0data type \u00a0is a classification identifying one of various types of data, such [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":0,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"wp:attachment":[{"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barkhane.com\/php\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}