Search value inside the array in php ~ PinoySourceCode

Friday, August 30, 2013

Search value inside the array in php

Title: Search value inside the array in php
Language: php
File size: 1kb
Tags: PHP


This example Search value inside the array in php is very understandable program.The use of this code is to searh the value inside the array.

This array stores multiple values in one single variable.and this array type is Associative arrays.

This is the sample code:
<?php
if(isset($_POST['submit']))
{
$found='no';
$data=array(23,24,25,26,27);
$num=$_POST['num'];
foreach($data as $value)
{
if($value==$num)
{
$found='yes';
break;
}
}
if($found=='yes')
echo "<script>alert('Value Found')</script>";
else
echo "<script>alert('Value not Found')</script>";
}
?>
If you want to try it to your self you can download the full code by clicking the download below.

System requirements to run php:
  • Xampp server or Wamp server to download this software click here.
  • Any Browser Google chrome,Firefox,Opera,Safari.. etc.
  • Php editor you can user Dreameaver,Notepad,Wordpad if you are using mac you can use textmate, or other compatible with your computer,for me i recommend Dreamweaver to easily fix the error if they have.
This is the simple how to run this program.
  • First Download the files here.
  • Next Extract the zip files to htdoc this is the path of htdocs(C://xampp/htdocs) 
  • Now go to your browser and follow this path(localhost/foldername/filename.php)

Click here to Download!

    Related Posts:

    • Forgot password with phpTitle: Forgot password with php Language: PHP File size: 2kb File name: forgot password.zip Tags:PHP Forgot password with php This system features… Read More
    • Export data to csv filesTitle: Export data to csv files Language: PHP File size: 1KB File name: export.zip Tags:PHP Export data to csv files This system is use to… Read More
    • Dynamic Combo box using Ajax and Php Title: Dynamic Combo box using Ajax and Php Language: PHP,Ajax File size: 2KB File name: dynamic combo box.zip Tags:PHP,JAVASCRIPT, AJAX, JQUERY… Read More
    • Title: Check person is eligiable for voting Language: PHP File size: 518bytes File name: checkperson.zip Tags:PHP Check Person is eligiable for voti… Read More
    • Captcha With PHPTitle: Captcha With PHP Language: PHP File size: 518bytes File name: captcha.zip Tags:PHP Captcha code very simple and easy to use no database ne… Read More

    0 (mga) komento:

    Post a Comment

    Get updates

    Twitter Facebook Google Plus LinkedIn RSS Feed Email

    Get Free Updates in Your Email


    Enter your email address:

    Popular Posts

    A visitor from Abuja viewed 'PinoySourceCode' 3 hrs 28 mins ago
    A visitor from Charleston viewed 'Payroll system simple but functional using php ~ P' 4 hrs 11 mins ago
    A visitor from Dire dawa viewed 'PinoySourceCode' 2 days 1 hr ago
    A visitor from Chandigarh viewed 'PinoySourceCode' 2 days 4 hrs ago
    A visitor from Abuja viewed 'PinoySourceCode' 3 days 23 hrs ago
    A visitor from Accra viewed 'PinoySourceCode' 4 days 13 hrs ago
    A visitor from Hyderabad viewed 'Payroll system simple but functional using php ~ P' 9 days ago
    A visitor from Fianarantsoa viewed 'PinoySourceCode' 9 days 1 hr ago
    A visitor from Kathmandu viewed 'PinoySourceCode' 9 days 8 hrs ago
    A visitor from Riviere du rempart viewed 'PinoySourceCode' 9 days 12 hrs ago