HomeMonday, June 26, 2017, 10:25:01
0

php Array

Tuesday, February 10, 15, 10:35:58, 2 Yaers Ago Via wain, Hits: 2772
These functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.
Example:
Code:
<?php
$acvalue = array(1 => 'value1',2 => 'value2',3 => 'value3');
echo"<pre>";
print_r ($acvalue);
echo"</pre>";
?>


http://phpform.net/images/array_screen.png

Mysql Example:
Code:
CREATE TABLE `test` (
`id` int(11) NOT NULL auto_increment,
`text0` text collate utf8_unicode_ci,
`text1` text collate utf8_unicode_ci,
`text2` text collate utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

INSERT INTO `test` VALUES (1, 'text1', 'text1a', 'text11a');
INSERT INTO `test` VALUES (2, 'text2', 'text2b', 'text22b');
INSERT INTO `test` VALUES (3, 'text3', 'text3c', 'text33c');


Code:
<?php
$dbhost = 'localhost';
$dbusername = 'root';
$dbpassword = '';
$dbname = 'testbase';
$link=mysql_connect($dbhost, $dbusername);
if(!$link) :
die('Could not connect: ' . mysql_error());
endif;
$db=mysql_select_db($dbname, $link);
if(!$db) :
die ('Cant connect to database : ' . mysql_error());
endif;
?>


Code:
<?php
include ('config.php');
$result = mysql_query("SELECT * FROM `test`")
or die(mysql_error());
while ($aclrow = mysql_fetch_assoc($result))
{
$aclvalue[0] = $aclrow;
echo"<pre>";
print_r($aclvalue[0]);
echo"</pre>";
}
?>


http://phpform.net/images/array_screen2.png

Sign In

Sponsor

Related

Stack Overflow Clone Script - Ja2BU

Open source question and answer script written in PHP, MySQL and jQuery. Main features are: SEO friendly url's, private message system, rating system, comments system.

E-Cards 1.1. PHP Script

This script will allow your visitors to send e-cards to their friends. It features admin notification and HTML output.To use the "e-cards" script completely free , the "powered by" link at the bottom of the pages must stay intact.

Link Base 2.0.

Manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links.

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

Process Form Data with Jquery

jQuery, Process form data

Upload Image with PHP [Example2]

[Example2] Tutorial - How to upload and resize image with PHP

PHP imagecreate

imagecreate() returns an image identifier representing a blank image of specified size.

Password Protect With PHP

Password protect tith PHP - tutorial

Bookmark Script

Allow your users to easily bookmark your site, by clicking on a link on the page.

View content in a zip file with PHP

List all files in a zip archive with PHP
About Author

cilipe

Date Registered: Mon, Feb 16, 15
Last Time Online: Wed, Feb 18, 15
So far has created 2 entries.
cilipe
This author has not yet filled in any details.