WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to pass an array to a function, or how to define a function wich recieves an array.
Categories : Variables, PHP, Arrays
Boaz Yahav
Date : Apr 26th 1998
Grade : 4 of 5 (graded 4 times)
Viewed : 26802
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

When trying to Define function like :

function DisplayMessages($threads[])

or when calling such a function you get an error
message like :

Parse error: parse error, expecting `')'' in...

The solution is that $threads[] should be just $threads. You can pass an
array, an integer, an
object or whatever else you have in mind, you're not supposed to specify
what type you're going to send in the function definition (since there are
no strict types anyway).




A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
Simple script to passing persistent and growing array between recalls of one page (manipulate little stack).
Categories : Arrays, Global Variables, PHP, HTML and PHP, Variables
Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI
Categories : Variables, PHP Options and Info, Arrays, URLs, PHP
Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
clearing variables in php3
Categories : Variables, Arrays, PHP
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
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
Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
Categories : PHP, Directories, Variables, Arrays
translate.php - Assocciative array example, passing a reference to a function.
Categories : PHP, Arrays, Languages, Variables
How to control the number of decimal places when outputting numbers.
Categories : PHP, Strings, Variables
This gets the http response headers for a given url and returns them in an assoc array. i.e. to test if a url exists: $array = get_http_headers($url); if($array[result]=200) { }
Categories : HTTP, Arrays, PHP
Link Submition - Allow your visitors to submit links to the site.
Categories : PHP, Arrays, Filesystem, Beginner Guides
BBCode Formatting String
Categories : PHP, HTML, Regexps, Arrays
Global Dump Highlighted
Categories : PHP, Variables, Global Variables
create a grid out of <INPUT TYPE=TEXT> then saving to a database. Uses a 'multi-dimension array', but not really as the array is just one big array with the index of "[$i][$j]". Have a look at the code and you'll see what I mean.
Categories : PHP, MySQL, Arrays, Databases