php-general Digest 1 Jan 2012 16:26:54 -0000 Issue 7631

Topics (messages 316140 through 316143):

Re: array
        316140 by: Ashley Sheridan
        316141 by: Govinda

Re: Error in portuguese translation of substr_compare
        316142 by: Daniel P. Brown

count clicks to count most important news
        316143 by: muad shibani

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Sat, 2011-12-31 at 14:53 +0100, saeed ahmed wrote:

> how can you explain someone in a simplest and everyday use example of ARRAY.
> 


The manual page explains it pretty succinctly. I don't think you'll get
more simple than this, as there is obvious prerequisite knowledge
assumed (i.e. that you know what a simple variable is, etc)
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
>> how can you explain someone in a simplest and everyday use example of ARRAY.
> 
> The manual page explains it pretty succinctly. I don't think you'll get
> more simple than this, as there is obvious prerequisite knowledge
> assumed (i.e. that you know what a simple variable is, etc)

Hi saeed,

Ash means this:

http://www.php.net/manual/en/language.types.array.php

See the examples in grey-colored boxes.

Arrays are just a collection of things.  Similar to when you assign one 
variable one value.. well with an array you assign many variables one value 
each.  But the reason you use an "array" is that instead of a bunch of separate 
variables, you want those variables to be part of a collection..  i.e. all 
those variables have something in common.. like for example you might use one 
array to describe the parts of a car, and another array to describe all the 
fruits in your kitchen.

You could do this:  (all separate independent variables)

$part1 = 'spark plug';
$part2 = 'rear-view mirror';
$part3 = 'steering wheel';
etc.

$fruit1 = 'apple';
$fruit2 = 'banana';
$fruit3 = 'orange';
etc.

...but (depending on your application, and the logic you use), it might make 
more sense to do something like this instead: (make arrays!)

(these, below, are arrays where the key is just a number which is automatically 
assigned.  You can also use another syntax (see the manual) to make arrays 
where you generate your own custom keys, and those keys can be strings instead 
of numbers.)

$arrParts = array('spark plug', 'rear-view mirror', 'steering wheel');

$arrFruits = array('apple', 'banana', 'orange');


To use the arrays, there are tons of functions:

http://www.php.net/manual/en/ref.array.php

:-)

-Govinda

--- End Message ---
--- Begin Message ---
    Forwarded to the proper address.

    Docs PT/PT-BR folks, please see the below email.  Thanks, and
happy new year!


On Fri, Dec 30, 2011 at 14:35, QI.VOLMAR QI <qi.vol...@gmail.com> wrote:
> I was read substr_compare description in portuguese language, an I
> asked myself to test it, so after several test, I found that its
> wrong.
> The text is in Portuguese:
>           "Se length é igual ou maior que o comprimento de main_str e
> length é setado, substr_compare() imprime warning e retorna FALSE."
>
> That is translated:
>          "If length is equal or bigger than size of main_str and
> length is setted, substr_compare() prints a warning and return FALSE"
>
> The original is:
>          If offset is equal to or greater than the length of main_str
> or length is set and is less than 1, substr_compare() prints a warning
> and returns FALSE.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--- End Message ---
--- Begin Message ---
I have a website that posts the most important news according to the number
of clicks to that news
the question is : what is the best  way to prevent multiple clicks from the
same visitor?

--- End Message ---

Reply via email to