Simple: Your suggestions for function parameters?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Simple: Your suggestions for function parameters?

Post by JAB Creations »

I just do not recall ever utilizing functions in PHP though I absolutely love and use them in JavaScript all the time. I'm curious about what I can do with parameters in PHP that may be useful but that I can not do in JavaScript. Here are a couple working examples that I put together... Yeah kind of strange that I have not begun messing with functions until this point. :|

Code: Select all

function my_function($my_parameter1, $my_parameter2)
{
echo $my_parameter1.$my_parameter2;
}
my_function('h','i');

Code: Select all

$my_parameter1 = 'g';
$my_parameter2 = 'o';
function my_function($my_parameter1, $my_parameter2)
{
echo $my_parameter1.$my_parameter2;
}
my_function($my_parameter1,$my_parameter2
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Simple: Your suggestions for function parameters?

Post by aceconcepts »

I've always found functions really really useful. One example I can give is when you INSERT data into a database i.e. a new user.

Simply call a function that takes for example a username and password and process them - Nice :D .
Post Reply