On Jan 16, 2008 6:32 PM, Stijn Leenknegt [EMAIL PROTECTED] wrote:
Hello
I've an idea for PHP6. Let's kickoff with an example.
?php
$info = getUserInformation($id); //return an array with all the
information
of an user.
echo $info['naam'];
?
This is nice, but when I want one element of
On Jan 16, 2008 6:32 PM, Stijn Leenknegt [EMAIL PROTECTED] wrote:
Hello
I've an idea for PHP6. Let's kickoff with an example.
?php
$info = getUserInformation($id); //return an array with all the information
of an user.
echo $info['naam'];
?
This is nice, but when I want one element of
Jim Lucas wrote:
I think this would be an easier/quicker fix for you then requesting that
the PHP developers re-write a large portion of the way PHP currently works.
Here is the reference that I have been looking for.
http://en.wikipedia.org/wiki/Message_passing
Jim
--
PHP General Mailing
Hello
I've an idea for PHP6. Let's kickoff with an example.
?php
$info = getUserInformation($id); //return an array with all the information
of an user.
echo $info['naam'];
?
This is nice, but when I want one element of the returned array, I have to
store the returned array into a variable and
On Wed, January 16, 2008 5:32 pm, Stijn Leenknegt wrote:
I've an idea for PHP6. Let's kickoff with an example.
This belongs on php-internals...
?php
echo getUserInformation($id)['naam'];
?
where it has already been discussed at length, and, as I recall,
rejected as too obfuscated for the
I think this would be an easier/quicker fix for you then requesting that
the PHP developers re-write a large portion of the way PHP currently works.
?php
function i($arr, $i) {
return $arr[$i];
}
echo i(getUserInformation($id), 'naam');
#or
echo i($object-fetchObjects(), 0)-method();
Stijn Leenknegt wrote:
This is nice, but when I want one element of the returned array, I
have to store the returned array into a variable and then call the
variable. The next code example is my idea.
?php
echo getUserInformation($id)['naam'];
?
Let's look further then this small
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
TGIF!!
I believe that's Copyright (C) TCompuserve. Careful you don't get tsued.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic
On 11/2/07, Stut [EMAIL PROTECTED] wrote:
Dan Shirah wrote:
That is correct, the due_date field should only accept a valid date
format,
such as MM/DD/. To bypass the need for a validation check for this
field I simply set the text field to disabled and supplied the user with
a
Dan Shirah wrote:
That is correct, the due_date field should only accept a valid date format,
such as MM/DD/. To bypass the need for a validation check for this
field I simply set the text field to disabled and supplied the user with a
javascript popup calendar that upon selection populates
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
Ah, okay. So I could probably simplfy it more by trimming it from the
start like this??
$due_date = trim($_POST['due_date']);
that works;
i personally prefer to initialize a variable then only set it if the
user input meets some
conditions;
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
Okay, so instead I should probably use:
if($due_date != )
$insert2.=, due_date='$due_date';
Instead of using empty()
using emtpy is fine; just store the results of trim in a temporary variable:
$trimmed = trim($due_date);
Okay, so instead I should probably use:
if($due_date != )
$insert2.=, due_date='$due_date';
Instead of using empty()
On 11/2/07, Nathan Nobbe [EMAIL PROTECTED] wrote:
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
TGIF!!
I have an insert statement that checks to see if a condition
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
TGIF!!
I have an insert statement that checks to see if a condition is met. If
it
is, then it adds that value to the insert statement. However, when I try
to
run it I get the error: Can't use function return value in write context
Below
TGIF!!
I have an insert statement that checks to see if a condition is met. If it
is, then it adds that value to the insert statement. However, when I try to
run it I get the error: Can't use function return value in write context
Below is a sample of what I am using which gives me the
Ah, okay. So I could probably simplfy it more by trimming it from the start
like this??
$due_date = trim($_POST['due_date']);
On 11/2/07, Nathan Nobbe [EMAIL PROTECTED] wrote:
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote:
Okay, so instead I should probably use:
if($due_date != )
That is correct, the due_date field should only accept a valid date format,
such as MM/DD/. To bypass the need for a validation check for this
field I simply set the text field to disabled and supplied the user with a
javascript popup calendar that upon selection populates the date in the
I know that while you should be doing proper validation on the server side
and everything, you could somewhat diminish the risk of someone building
their own form and just posting. If you were to check the referring site
which made the post then you could be pretty sure someone didn't make
Hi people.
Is it possible to return multiple values in a function.
For instance, i want to do something like this:
function calculate_money($sum)
{
// some hanky panky calculations
return $type;
return $amount;
}
Thanks!
Sincerely,
Faisal
__
--
PHP
Hi Faisal,
Is it possible to return multiple values in a function.
For instance, i want to do something like this:
function calculate_money($sum)
{
// some hanky panky calculations
return $type;
return $amount;
}
You have to return the values in an array, and use list() to break
Hi all,
I have a Q about functions. My function should return 2 values. What syntax
should I use and how do I call these values outside the function? Are these
values returned as en array or something?
this is what I have now,
-
function myFunction($some_vars)
{
Hi,
I don't know if there is an easier way to do this but why don't you concatenate
the two values to be returned and then split the returned value ?
ex :
function myFunction($some_vars)
{
$max=count($some_vars);
$some_value=($max/2);
$result = $some_value.;.$max;
return $result;
}
$resultado
I have a Q about functions. My function should return 2
values. What
syntax should I use and how do I call these values outside the
function? Are these values returned as en array or something?
I don't know if there is an easier way to do this but why
don't you concatenate the
-
From: W. Enserink [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 10:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] function return
Hi all,
I have a Q about functions. My function should return 2 values. What syntax
should I use and how do I call these values outside the function
-
From: W. Enserink [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 28, 2002 4:01 AM
Subject: [PHP] function return
Hi all,
I have a Q about functions. My function should return 2 values. What
syntax
should I use and how do I call these values outside the function
On Tue, 28 May 2002, W. Enserink wrote:
I have a Q about functions. My function should return 2 values. What
syntax should I use and how do I call these values outside the function?
Are these values returned as en array or something?
this is what I have now,
-
i'm trying to make all my include files into functions for
manageability. I have one function that i'd like to get to work.heres
teh code..
?php
$db = mysql_pconnect("localhost", "user" ,"pass");
mysql_select_db("database",$db);
?
i had it in a function and had the function return
MySQL_fetch_array($result))
{
$thing=$myrow["item"];
echo "$thing br
";
}
?
- Original Message -
From: Kurth Bemis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 06, 2001 4:10 PM
Subject: [PHP] function return
i'm trying to make all my include f
I usually declare $db as global in the function, so I can just execute the
function and continue with my querys.
--
Plutarck
Should be working on something...
...but forgot what it was.
"Kurth Bemis" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
i'm trying
29 matches
Mail list logo