Definition và Usage
The in_array() function searches an array for a specific value.Bạn vẫn xem: In_array php w3schools code example
This function returns TRUE if the value is found in the array, or FALSE otherwise.
Bạn đang xem: Hướng dẫn sử dụng hàm in_array() trong php
Syntax
in_array(search,array,type) |
search | Required. Specifies the what to search for |
array | Required. Specifies the array to lớn search |
type | Optional. If this parameter is set, the in_array() function searches for the search-string và specific type in the array |
Tips and Notes
Note: If the search parameter is a string & the type parameter is set khổng lồ TRUE, the tìm kiếm is case-sensitive.Example 1
|
Match found |
Example 2
"; }else echo "Match not found"; if (in_array("Glenn",$people, TRUE)) echo "Match found"; else echo "Match not found"; if (in_array(23,$people, TRUE)) echo "Match found"; else echo "Match not found"; ?> |
Match not foundMatch foundMatch found |
Reliable, affordable, feature-rich website hosting!

Take the uncertainty out of web hosting and letGoDaddy.comput service, performance & value back in. No matter whichhosting type or plan you choose, your site receives 24/7maintenance and protection in our world-class data center. Plus,you get the expert, friendly service you deserve, from theworld"s largest hostname provider.
With three plans to choose from andprices starting at just $4.99 per month, GoDaddy.com is sure to have a plan that"sright-sized & right-priced just for you!
All plans feature không tính phí 24x7 setup, không tính tiền 24x7 monitoring, best-of-breed routers, firewalls and servers, 24x7 onsite physical securityand access lớn our exclusive Go Daddy Hosting Connection, THE placeto install over 30 không tính phí applications. Virtual Dedicated & DedicatedServer plans also available.Visit GoDaddy.com today.
Save 10% on website hosting - Enter code w3tenoff at checkout
![]() | Get Your Diploma!darkedeneurope.com.com" Online Certification Program is the perfect solution for busy professionals who need to balance work, family, và career building. Xem thêm: Dấu Hiệu Con Trai Thích Mình, Nhận Ra Một Chàng Trai Đang Thích Mình The HTML Certificate is for developers who want to lớn document their knowledge of HTML, XHTML, và CSS. The JavaScript Certificate is for developers who want to lớn document their knowledge of JavaScript and the HTML DOM. The XML Certificate is for developers who want lớn document their knowledge of XML, XML DOM và XSLT. The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, và ADO. The PHP Certificate is for developers who want to document their knowledge of PHP & SQL (MySQL). |
$15 tên miền NameRegistrationSave $20 / year! |
Buy UK tên miền NamesRegister tên miền Names |
Cheap domain NamesCheap website Hosting |
Best website Hosting |
PHP MySQL Hosting |
Top 10 web Hosting |
UK Reseller Hosting |
Web Hosting |
FREE web Hosting |
Website TemplatesFlash TemplatesWebsite BuilderInternet Business Opportunity |
Custom Programming |
FREE Trial or DemoWeb nội dung ManagerForms,Web Alerts,RSS |
Download XML editor |
FREE Flash Website |
FREE web Templates |
US Web thiết kế Schools |
HTML Certification |
JavaScript Certification |
XML Certification |
PHP Certification |
ASP Certification |

HOME orTop of Page