Leave a comment

Array

How to Create Array in PHP

<?php

$myarray = array(

“a” => “Apple”,

“b” => “Apple”,

“c” => “Apple”,

“d” => “Apple”,

)  ?>

Catch Value from Form

<?php

$postid = $_POST[‘search’];

foreach($myarray as $postid => $value)

echo “$postid”;

?>

Send value from Form

<?php

$_POST[search];

?>

HTML Form

<form action=”yourpage.php” method=”post”>

<input type=”text” name=”search” />

<input type=”submit” value=”Search” />

</form>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: