Need A function which...

Need A function which...

am 10.10.2007 12:00:56 von goldnery

Hi everyone,
I'm looking for a function which combine int values from an array (or
a string).

example:

$x[0]=5;
$x[1]=2;
$x[2]=3;

$y= *needed_function($x);
echo $y // suppose to return 10


thanks

Re: Need A function which...

am 10.10.2007 12:11:59 von Lars Eighner

In our last episode,
<1192010456.828186.125800@v3g2000hsg.googlegroups.com>,
the lovely and talented Gandalf
broadcast on comp.lang.php:

> Hi everyone, I'm looking for a function which combine int values from an
> array (or a string).

> example:

> $x[0]=5;
> $x[1]=2;
> $x[2]=3;

> $y= *needed_function($x);
> echo $y // suppose to return 10


You know if you even glanced at the function index in the manual,
array_sum would have jumped out at you.

--
Lars Eighner
Countdown: 468 days to go.
What do you do when you're debranded?

Re: Need A function which...

am 10.10.2007 13:24:03 von Shelly

"Lars Eighner" wrote in message
news:slrnfgp99i.rb.usenet@debranded.larseighner.com...
> In our last episode,
> <1192010456.828186.125800@v3g2000hsg.googlegroups.com>,
> the lovely and talented Gandalf
> broadcast on comp.lang.php:
>
>> Hi everyone, I'm looking for a function which combine int values from an
>> array (or a string).
>
>> example:
>
>> $x[0]=5;
>> $x[1]=2;
>> $x[2]=3;
>
>> $y= *needed_function($x);
>> echo $y // suppose to return 10
>
>
> You know if you even glanced at the function index in the manual,
> array_sum would have jumped out at you.

Even without having array_sum, writing such a function is so trivial that it
makes you wonder if the op has ANY programming experience.

>
> --
> Lars Eighner
>
> Countdown: 468 days to go.

Is 468 the number of days left until we finally get rid of the dumbo in the
oval office?

Shelly

Re: Need A function which...

am 10.10.2007 13:50:25 von goldnery

On Oct 10, 1:24 pm, "Shelly" wrote:
> "Lars Eighner" wrote in message
>
> news:slrnfgp99i.rb.usenet@debranded.larseighner.com...
>
>
>
> > In our last episode,
> > <1192010456.828186.125...@v3g2000hsg.googlegroups.com>,
> > the lovely and talented Gandalf
> > broadcast on comp.lang.php:
>
> >> Hi everyone, I'm looking for a function which combine int values from an
> >> array (or a string).
>
> >> example:
>
> >> $x[0]=5;
> >> $x[1]=2;
> >> $x[2]=3;
>
> >> $y= *needed_function($x);
> >> echo $y // suppose to return 10
>
> > You know if you even glanced at the function index in the manual,
> > array_sum would have jumped out at you.
>
> Even without having array_sum, writing such a function is so trivial that it
> makes you wonder if the op has ANY programming experience.
>
>
>
> > --
> > Lars Eighner
> >
> > Countdown: 468 days to go.
>
> Is 468 the number of days left until we finally get rid of the dumbo in the
> oval office?
>
> Shelly

thanks, now that i see the answer it really was kine of a stupid
question

Re: Need A function which...

am 10.10.2007 14:39:13 von Captain Paralytic

On 10 Oct, 11:11, Lars Eighner wrote:
> You know if you even glanced at the function index in the manual,
> array_sum would have jumped out at you.
If people started looking at the manuals, what would I do all day.

Re: Need A function which...

am 10.10.2007 20:55:40 von Bucky Kaufman

"Captain Paralytic" wrote in message
news:1192019953.666350.159490@22g2000hsm.googlegroups.com...
> On 10 Oct, 11:11, Lars Eighner wrote:

>> You know if you even glanced at the function index in the manual,
>> array_sum would have jumped out at you.

> If people started looking at the manuals, what would I do all day.

Write tech manuals? :)