d\u1eef li\u1ec7u Boolean ch\u00fang ta ghi TRUE ho\u1eb7c FALSE<\/a>. <\/p>\n\n\n\nC\u00e1ch vi\u1ebft ch\u1eef th\u01b0\u1eddng true, false v\u1eabn h\u1ee3p l\u1ec7, nh\u01b0ng t\u00f4i th\u01b0\u1eddng vi\u1ebft IN HOA h\u01a1n, n\u1ebfu ch\u1ecdn ki\u1ec3u n\u00e0o b\u1ea1n n\u00ean th\u1ed1ng nh\u1ea5t. B\u1ea1n r\u1ea5t hay s\u1eed d\u1ee5ng ki\u1ec3u Boolean trong h\u00e0m IF.<\/p>\n\n\n\n
V\u00ed d\u1ee5: <\/p>\n\n\n\n
<?php if (x > 0) {y=5;} ?><\/code><\/pre>\n\n\n\nx > 0 ph\u1ea3i c\u00f3 gi\u00e1 tr\u1ecb TRUE th\u00ec \u0111i\u1ec1u ki\u1ec7n sau m\u1edbi \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n<\/p>\n\n\n\n
\n\n\n\n<\/span>Ki\u1ec3u chu\u1ed7i (string data type<\/i>)<\/span><\/h2>\n\n\n\nD\u00f9ng \u0111\u1ec3 l\u01b0u k\u00fd t\u1ef1, ch\u1eb3ng h\u1ea1n nh\u01b0 t\u00ean, v\u0103n b\u1ea3n. \u0110\u1ec3 vi\u1ebft gi\u00e1 tr\u1ecb chu\u1ed7i ta ph\u1ea3i \u0111\u1eb7t n\u00f3 trong d\u1ea5u nh\u00e1y \u0111\u01a1n ho\u1eb7c nh\u00e1y k\u00e9p \u2013 l\u01b0u \u00fd l\u00e0 n\u1ebfu d\u1ea5u m\u1edf l\u00e0 nh\u00e1y \u0111\u01a1n th\u00ec d\u1ea5u \u0111\u00f3ng c\u0169ng ph\u1ea3i l\u00e0 nh\u00e1y \u0111\u01a1n – d\u1ea5u m\u1edf l\u00e0 nh\u00e1y k\u00e9p th\u00ec d\u1ea5u \u0111\u00f3ng c\u0169ng l\u00e0 nh\u00e1y k\u00e9p.<\/p>\n\n\n\n
V\u00ed d\u1ee5: <\/p>\n\n\n\n
<?php echo \"Ki\u1ebfn c\u00e0ng\"; ?><\/code><\/pre>\n\n\n\n
\n\n\n\n<\/span>Ki\u1ec3u NULL<\/span><\/h2>\n\n\n\nNull l\u00e0 ki\u1ec3u d\u1eef li\u1ec7u \u0111\u1eb7c bi\u1ec7t ch\u1ec9 c\u00f3 duy nh\u1ea5t m\u1ed9t gi\u00e1 tr\u1ecb: NULL<\/p>\n\n\n\n
M\u1ed9t bi\u1ebfn c\u1ee7a ki\u1ec3u d\u1eef li\u1ec7u NULL l\u00e0 bi\u1ebfn kh\u00f4ng c\u00f3 gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c g\u00e1n cho n\u00f3.<\/p>\n\n\n\n
M\u1eb9o: N\u1ebfu m\u1ed9t bi\u1ebfn \u0111\u01b0\u1ee3c kh\u1edfi t\u1ea1o m\u00e0 kh\u00f4ng g\u00e1n gi\u00e1 tr\u1ecb, n\u00f3 \u0111\u01b0\u1ee3c t\u1ef1 \u0111\u1ed9ng g\u00e1n gi\u00e1 tr\u1ecb l\u00e0 NULL.<\/p>\n\n\n\n
C\u00f3 th\u1ec3 l\u00e0m c\u00e1c bi\u1ebfn tr\u1edf n\u00ean tr\u1ed1ng r\u1ed7ng b\u1eb1ng c\u00e1ch \u0111\u01b0a gi\u00e1 tr\u1ecb c\u1ee7a n\u00f3 v\u1ec1 NULL.<\/p>\n\n\n\n
\n\n\n\n<\/span>Ki\u1ec3u m\u1ea3ng (Array)<\/span><\/h2>\n\n\n\nM\u1ed9t m\u1ea3ng c\u00f3 kh\u1ea3 n\u0103ng ch\u1ee9a nhi\u1ec1u gi\u00e1 tr\u1ecb v\u00e0o trong m\u1ed9t bi\u1ebfn.<\/p>\n\n\n\n
Trong v\u00ed d\u1ee5 d\u01b0\u1edbi \u0111\u00e2y $canhan l\u00e0 m\u1ed9t m\u1ea3ng.<\/p>\n\n\n\n
$canhan = array(\"Nguyen Duc Anh\",\"11\/7\/1987\",\"Thuong Tin, Ha Noi\");<\/code><\/pre>\n\n\n\n
\n\n\n\n<\/span>Ki\u1ec3u \u0111\u1ed1i t\u01b0\u1ee3ng (Object)<\/span><\/h2>\n\n\n\nC\u00e1i n\u00e0y t\u00f4i ch\u01b0a hi\u1ec3u nhi\u1ec1u n\u00ean s\u1ebd vi\u1ebft sau nh\u00e9.<\/p>\n\n\n\n
\n\n\n\n<\/span>Th\u00eam m\u1ed9t s\u1ed1 v\u00ed d\u1ee5<\/span><\/h2>\n\n\n\n- S\u1ed1 ng\u01b0\u1eddi trong m\u1ed9t l\u1edbp h\u1ecdc<\/strong>: \u0111\u00e2y l\u00e0 ki\u1ec3u s\u1ed1 v\u00e0 ch\u00fang ta n\u00ean m\u00f4 t\u1ea3 n\u00f3 d\u01b0\u1edbi ki\u1ec3u s\u1ed1 nguy\u00ean l\u00e0 th\u00edch h\u1ee3p nh\u1ea5t, v\u00ec trong th\u1ef1c t\u1ebf kh\u00f4ng c\u00f3 s\u1ed1 l\u01b0\u1ee3ng ng\u01b0\u1eddi ki\u1ec3u th\u1eadp ph\u00e2n nh\u01b0 12,7 ng\u01b0\u1eddi!<\/li>
- Gi\u00e1 c\u1ea3, t\u1ed5ng ti\u1ec1n<\/strong>: c\u00e1i n\u00e0y c\u0169ng d\u00f9ng ki\u1ec3u s\u1ed1, nh\u01b0ng l\u1ea7n n\u00e0y ta n\u00ean d\u00f9ng ki\u1ec3u th\u1eadp ph\u00e2n v\u00ec c\u00e1c con s\u1ed1 li\u00ean quan \u0111\u1ebfn ti\u1ec1n t\u1ec7 th\u01b0\u1eddng c\u00f3 s\u1ed1 l\u1ebb, v\u00e0 \u0111\u00f4i khi c\u00f3 gi\u00e1 tr\u1ecb r\u1ea5t l\u1edbn. N\u1ebfu b\u1ea1n tri\u1ec3n khai c\u00e1c \u1ee9ng d\u1ee5ng to\u00e1n h\u1ecdc th\u00ec th\u01b0\u1eddng b\u1ea1n s\u1ebd d\u00f9ng ki\u1ec3u th\u1eadp ph\u00e2n h\u01a1n l\u00e0 ki\u1ec3u s\u1ed1 nguy\u00ean.<\/li>
- H\u1ecd t\u00ean<\/strong>: ki\u1ec3u chu\u1ed7i \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 m\u00f4 t\u1ea3 h\u1ecd t\u00ean, th\u00ed d\u1ee5 trong tr\u01b0\u1eddng nh\u1eadp h\u1ecd t\u00ean c\u1ee7a MySQL b\u1ea1n th\u01b0\u1eddng \u0111\u1ec3 ki\u1ec3u d\u1eef li\u1ec7u l\u00e0 Varchar. Bi\u1ebfn $ho_ten trong PHP \u0111\u1ec3 l\u01b0u d\u1eef li\u1ec7u tr\u01b0\u1edbc khi th\u00eam v\u00e0o CSDL d\u0129 nhi\u00ean ph\u1ea3i c\u00f3 ki\u1ec3u chu\u1ed7i.<\/li>
- N\u1ebfu b\u1ea1n d\u00f9ng h\u00e0m \u0111i\u1ec1u ki\u1ec7n, ki\u1ec3u nh\u01b0 n\u1ebfu \u0111i\u1ec3m t\u1ed5ng k\u1ebft d\u01b0\u1edbi 5.0 th\u00ec ph\u1ea3i h\u1ecdc l\u1ea1i, c\u00e1i \u0111i\u1ec1u ki\u1ec7n d\u01b0\u1edbi 5.0 ch\u01b0a bi\u1ebft \u0111\u00fang hay sai (v\u00ec c\u00f2n t\u00f9y tr\u01b0\u1eddng h\u1ee3p c\u1ee5 th\u1ec3) n\u00e0y ch\u00ednh l\u00e0 Boolean.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"
Hi\u1ec3u r\u00f5 c\u00e1c ki\u1ec3u d\u1eef li\u1ec7u c\u01a1 b\u1ea3n trong m\u1ed9t ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh l\u00e0 y\u00eau c\u1ea7u thi\u1ebft y\u1ebfu gi\u00fap b\u1ea1n c\u00f3 nh\u1eefng d\u00f2ng code h\u1ee3p chu\u1ea9n v\u00e0 ch\u00ednh x\u00e1c c\u0169ng nh\u01b0 tr\u00e1nh cho b\u1ea1n nh\u1eefng r\u1eafc r\u1ed1i li\u00ean quan \u0111\u1ebfn x\u1eed l\u00fd d\u1eef li\u1ec7u. PHP c\u00f3 s\u00e1u ki\u1ec3u d\u1eef li\u1ec7u c\u01a1 b\u1ea3n, v\u00e0 ch\u00fang …<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[238],"tags":[],"yoast_head":"\n
L\u1eadp tr\u00ecnh web: C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u trong PHP • Ki\u1ebfn c\u00e0ng<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n","yoast_head_json":{"title":"L\u1eadp tr\u00ecnh web: C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u trong PHP • Ki\u1ebfn c\u00e0ng","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:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/","og_locale":"vi_VN","og_type":"article","og_title":"L\u1eadp tr\u00ecnh web: C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u trong PHP • Ki\u1ebfn c\u00e0ng","og_description":"Hi\u1ec3u r\u00f5 c\u00e1c ki\u1ec3u d\u1eef li\u1ec7u c\u01a1 b\u1ea3n trong m\u1ed9t ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh l\u00e0 y\u00eau c\u1ea7u thi\u1ebft y\u1ebfu gi\u00fap b\u1ea1n c\u00f3 nh\u1eefng d\u00f2ng code h\u1ee3p chu\u1ea9n v\u00e0 ch\u00ednh x\u00e1c c\u0169ng nh\u01b0 tr\u00e1nh cho b\u1ea1n nh\u1eefng r\u1eafc r\u1ed1i li\u00ean quan \u0111\u1ebfn x\u1eed l\u00fd d\u1eef li\u1ec7u. PHP c\u00f3 s\u00e1u ki\u1ec3u d\u1eef li\u1ec7u c\u01a1 b\u1ea3n, v\u00e0 ch\u00fang …","og_url":"https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/","og_site_name":"Ki\u1ebfn c\u00e0ng","article_author":"https:\/\/www.facebook.com\/anhducnguyen87\/","article_published_time":"2013-08-23T07:14:00+00:00","author":"Nguy\u1ec5n \u0110\u1ee9c Anh","twitter_card":"summary_large_image","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Nguy\u1ec5n \u0110\u1ee9c Anh","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"4 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/","url":"https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/","name":"L\u1eadp tr\u00ecnh web: C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u trong PHP • Ki\u1ebfn c\u00e0ng","isPartOf":{"@id":"https:\/\/kiencang.net\/#website"},"datePublished":"2013-08-23T07:14:00+00:00","dateModified":"2013-08-23T07:14:00+00:00","author":{"@id":"https:\/\/kiencang.net\/#\/schema\/person\/5e7e1a04d8d1218ad8c421ba43d25c16"},"breadcrumb":{"@id":"https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kiencang.net\/lap-trinh-web-cac-kieu-du-lieu-trong-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kiencang.net\/"},{"@type":"ListItem","position":2,"name":"L\u1eadp tr\u00ecnh web: C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u trong PHP"}]},{"@type":"WebSite","@id":"https:\/\/kiencang.net\/#website","url":"https:\/\/kiencang.net\/","name":"Ki\u1ebfn c\u00e0ng","description":"\u00d4m l\u00fd thuy\u1ebft, h\u00f4n th\u1ef1c h\u00e0nh","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kiencang.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"vi"},{"@type":"Person","@id":"https:\/\/kiencang.net\/#\/schema\/person\/5e7e1a04d8d1218ad8c421ba43d25c16","name":"Nguy\u1ec5n \u0110\u1ee9c Anh","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/kiencang.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6d71f9b89393952a8382e30dad26c1ec?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6d71f9b89393952a8382e30dad26c1ec?s=96&d=monsterid&r=g","caption":"Nguy\u1ec5n \u0110\u1ee9c Anh"},"description":"Sinh n\u0103m 1987, t\u1ed1t nghi\u1ec7p Cao \u0111\u1eb3ng th\u1ef1c h\u00e0nh FPT qu\u00e3ng 2014, chuy\u00ean ng\u00e0nh Thi\u1ebft k\u1ebf website. T\u00f4i th\u00edch Content, SEO, Ads, T\u0103ng t\u1ed1c website v\u00e0 Th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed. B\u00ean c\u1ea1nh b\u00e0i t\u1ef1 vi\u1ebft, t\u00f4i c\u0169ng d\u1ecbch nhi\u1ec1u n\u1ed9i dung th\u00fa v\u1ecb c\u1ee7a c\u00e1c t\u00e1c gi\u1ea3 kh\u00e1c nhau. FB c\u00e1 nh\u00e2n: facebook.com\/anhducnguyen87. Email li\u00ean h\u1ec7: guiemailchotoi@gmail.com","sameAs":["https:\/\/www.facebook.com\/anhducnguyen87\/"],"url":"https:\/\/kiencang.net\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts\/12411"}],"collection":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/comments?post=12411"}],"version-history":[{"count":0,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts\/12411\/revisions"}],"wp:attachment":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/media?parent=12411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/categories?post=12411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/tags?post=12411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}