Searching in Array
Duration: 2 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Prelims: General Knowledge: Physics Chemistry Biology History Geography Polity Indian Economy Static General Knowledge GK- Current Affairs Environment
- Prelims: General English: Vocabulary Noun Pronoun Adjectives Preposition Articles Direct and Indirect Speech Tenses Conjunction Subject Verb Agreement (Verb Noun Agreement) Modals Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing) Sentence Correction (Error Correction) Sentence Completion (Fill in the blanks) Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions) Cloze Test (Cloze Passage) Verbal Analogy (Word Based Analogy) Sentence Construction Adverb Verb
- Prelims: Quantitative Aptitude: Percentage Ratio and Proportion (Ratios) HCF LCM Divisibility Rules Average Sequence and Series (Series) Number System Powers and Exponents (Surds and Indices) Algebra Profit and Loss Simple Interest and Compound Interest Time and Work Pipe and Cistern Speed Time and Distance Mixture and Alligation Mensuration and Geometry Age Problems Partnership Statistics Data Interpretation Arithmetic
- Prelims: General Agriculture: Agriculture in India and Tripura Natural Resource Management Fundamentals of Crop Production Horticulture Crop Improvement Crop Protection Social Science
- IT Mains: Operating System: Introduction to OS Process Management CPU Scheduling Process Synchronization Threads & Process Creation Deadlock Memory Management Virtual Memory Disc Scheduling File Management Distributed Systems
- IT Mains: Computer Networking: Introduction to CN DLL: Access Control DLL: Flow Control DLL: Error Control Data Link Layer - Ethernet Net Layer: IPv4 & Proto Net Layer: IP Addressing Net Layer:Routing Protocol Transport Layer Services TL: Congestion & UDP Application Layer Hardware Basics Network Security
- IT Mains: DBMS: Basics of DBMS ER Diagram Relational Model & Functional Dependencies Keys & Integrity Constraints Normalization (1NF - BCNF) Decomposition Properties & 4NF Relational Algebra SQL Relational Calculus Transaction Management Concurrency Control Database Recovery Big Data Systems Database Security & Authorization Enhanced Data Models NoSQL
- IT Mains: Software Engineering: Fundamentals of Software Engineering Software Requirements and Quality Assurance Software Design, Estimation and Metrics Software Testing Software Maintenance and Configuration Management
- IT Mains: Data Structures & Algorithms: Introduction to DS Array Stack Queue Linked List Tree Graphs Hashing Algorithm Analysis Time Complexity Analysis Sorting Algorithms
- IT Mains: OOPS with C++ & Java: C Fundamentals OOPS with C++ Java Fundamentals Array, String, IO & References OOPS with Java Generic & Collections Multithreading File Handling & I/O
- IT Mains: Python: Introduction to Python Tokens, Variables, Data Types, I/O Operators & Expressions Control Flow & Looping Collections & Strings Functions & Modules
- IT Mains: Website Development: Website, Browser & Services Internet Fundamentals Web Design & Development Protocols & Services Web Publishing & Hosting Server Side & Security Emerging Technologies HTML Basics HTML5 CSS JavaScript-Basics .Net Programming PHP
- IT Mains: Mobile App Development: Mobile Computing Multimedia
- IT Mains: Linux / Windows Server Admin: Unix OS Linux OS
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This short PHP lecture segment focuses on searching an array using the in_array() function. The instructor introduces the concept that in_array() checks whether a specific value exists within an array, returning true or false. On the whiteboard, he writes a PHP script defining $numbers = [10, 20, 30, 5, 12] and then calls echo in_array(30, $numbers); to demonstrate the search. A hand-drawn arrow points to the 30 in the array, visually linking the searched value to its location. The projected slide reinforces this with the definition and an 'Important Points' list noting that indexed arrays use numeric keys. The final output shown is true, confirming the value was found.
Chapters
0:00 – 2:00 00:00-02:00
The instructor introduces the PHP in_array() function for checking if a value exists in an array. He writes on the whiteboard: <?php, then $numbers = [10, 20, 30, 5, 12], followed by echo in_array(30, $numbers);. A hand-drawn arrow points to the 30 in the array. The slide behind him reads '9. Searching an Array — in_array()' and states 'The in_array() function checks whether a value exists in an array.' An 'Important Points' list includes 'Indexed arrays use numeric keys' and 'in_array() searches for a value in an array.' The code builds progressively across the window, ending with the complete function call.
2:00 – 2:18 02:00-02:18
The instructor completes the demonstration by showing the output of the in_array() call. The whiteboard now displays the full code: <?php, $numbers = [10, 20, 30, 5, 15, 10], echo in_array(30, $numbers);, and the result true. This confirms that when the searched value (30) is present in the array, in_array() returns true. The slide remains visible with the same title and definition text.
The lesson teaches a single, focused PHP concept: using in_array() to search for a value in an array. The key takeaway is that in_array(needle, haystack) returns true if the needle exists in the haystack array, and false otherwise. The worked example uses $numbers = [10, 20, 30, 5, 12] and searches for 30, yielding true. The instructor emphasizes that indexed arrays use numeric keys (0, 1, 2, ...) and that in_array() searches by value, not by key. The visual arrow from the function argument to the array element reinforces the matching process. For exam revision, students should remember: (1) in_array() takes two arguments — the value to search for and the array; (2) it returns a boolean; (3) it is case-sensitive for strings and type-dependent by default; (4) the example output true demonstrates a successful match. Note: one screenshot shows the array as [10, 20, 30, 5, 15, 10] while earlier frames show [10, 20, 30, 5, 12]; the exact final element may vary slightly due to sampling, but the core demonstration of finding 30 remains consistent.

