Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-22-2004, 05:59 PM   #1 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 209
falsepride is on a distinguished road
function help

is there a way to make a function where certian arguments are not needed?
falsepride is offline   Reply With Quote
Old 11-22-2004, 06:15 PM   #2 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Yes, if there is a default value you want your function to use, but you want to be able to use some other value occasionally, create the function like this

PHP Code:
function some_function($foo$bar 7) {


Writing the function like that will allow you to call the function without a value for $bar and it will default to 7, or you can give it a different value if you wish.
__________________
Current Project
Redline is offline   Reply With Quote
Old 11-22-2004, 06:17 PM   #3 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 209
falsepride is on a distinguished road
thanks but too late, i realized that i could just changed a file in a little way, and it would do what i want. im writing a function that reads a file into a mutltidemensional array, as far as i know theres no php function to do this right?
falsepride is offline   Reply With Quote
Old 11-22-2004, 06:21 PM   #4 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Yeah I highly doubt that there is a built in function to read files into an array. It's not a complex procedure but there are too many variables for that to work as a built in function. File name/location, fields, delimters etc
__________________
Current Project
Redline is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL-Mathematical function fdtoo Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 0 08-20-2004 04:48 AM
Custom function bdl PHP 3 03-07-2003 05:53 PM
pass filename to function Blaqb0x Standard C, C++ 1 09-02-2002 10:12 PM
trouble calling auxiliary function in a class brtklt Standard C, C++ 0 07-18-2002 05:22 PM


All times are GMT -8. The time now is 09:29 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting