<?
// Function for loading an array with an object. I tried loading the array by
// setting $event_object equal to the object, which didn't seem to return the right
// values for later use.
// I ended up pushing objects (using array_push($_name_of_array_,
// $_object_or_value_to_push_) ). This enable me to use the return the $event_list
// array in a usable form.
function getEvents($filename) {
//string $filename
$event_list = array();
$event_object = new event();
$i = 0;
@ $fp = fopen($filename, "r");
if(!$fp) {
echo "<p><strong>Cannot open ".$filename." for reading mode...</strong></p>";
exit;
}
while(!feof($fp)) {
$temp = fgetcsv($fp, 1024, ":");
if(!$temp) break;
$event_object->init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],
$temp[5],$temp[6],$temp[7],$temp[8]);
if(!array_push($event_list, $event_object)) break;
}
fclose($fp);
return $event_list;
}
// If anyone is interested in seeing the entire class definition, just let me know
// by emailing me at josh@acsurf.net
Single-file PHP news system with automatic folder structure creation Categories : PHP , Filesystem , Arrays Parsing html tags with php. Get an array from this function Categories : PHP , HTML and PHP , Arrays , Tag Extractors Takes an array and returns a string, suitable for inputing in an SQL statement
Categories : Arrays , Strings , PHP Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP , PHP , HTML , PDF , Excel Check for functional file links (broken Files)
Categories : PHP , Data Validation , FTP , Regexps , Arrays Grab images from one or more URLs and save them to a specified local directory. Categories : PHP , Filesystem , Strings , Arrays How to Get a character array from a string Categories : PHP , Strings , Arrays PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside. Categories : PHP , Arrays , Variables This functions makes it easy to use session-variables known from ASP. With one Cookie the array "session" will save and restore from a db-record. In this version MySQL is used but it's should very easy to change Categories : PHP , Arrays , Cookies , MySQL , Databases Simple PHP Bar Graph using GD library Categories : PHP , GD image library , Graphics , Arrays A class to put get and post variables in hidden form
elements. Works on scalars, normal arrays, associative
arrays. Categories : Algorithms , Variables , Arrays , PHP , PHP Classes Weighted Random - Random Scripts usually chose one out of each item, and each item have an equal chance to be chosen. But what if you want an item to be chosed more frequently than other? Categories : PHP , Math. , Arrays Function that returns an array with the 7 dates of the week that belong to the supplied date. Categories : PHP , Date Time , Arrays Human readable PHP password generator Categories : PHP , Security , Beginner Guides , Arrays How to pass an array to a function, or how to define a
function wich recieves an array. Categories : Variables , PHP , Arrays