array
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
First idea to come into my head:
- Sort the array elements alphabetically.
Loop through every element (except the last one) and check to see if it's identical to the element after it.
If it is not identical, add it to a seperate array.
array of numbers (pass-by-value) arrays (pass-byreference)
Thanks a lot.
This is another question.
I din expect complete coding.
I just need some ideas.
Parameter: An array of numbers (pass-by-value) and two arrays (pass-byreference)
Return value: None
Result: The first pass-by-reference parameter must have the values of the given array
This is another question.
I din expect complete coding.
I just need some ideas.
Parameter: An array of numbers (pass-by-value) and two arrays (pass-byreference)
Return value: None
Result: The first pass-by-reference parameter must have the values of the given array
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: array of numbers (pass-by-value) arrays (pass-byreferenc
That doesn't make sense. I presume you're wanting it to return a boolean depending on the success. I don't understand what you've specified in the parameter or result bit either; are you wanting to specify 2 array's of numbers and see if they contain the same values?horszelim wrote: Parameter: An array of numbers (pass-by-value) and two arrays (pass-byreference)
Return value: None
Result: The first pass-by-reference parameter must have the values of the given array
I still do not understand
Maybe you're looking for something like http://de3.php.net/array_intersect or http://de3.php.net/array_diff , maybe not.
ok, 2. Buthorszelim wrote:There are two array.
now there are three of them?horszelim wrote:First is an array of numbers which is pass-by-value.
Second is two arrays which pass-byreference.
all three are "given", which one do you mean? What does "have the values" mean? Please elucidate.After that, the first pass-by-reference parameter must have the values of the given array(first array)
Maybe you're looking for something like http://de3.php.net/array_intersect or http://de3.php.net/array_diff , maybe not.
sorry cos make u confuse.
only have 2 array
first array are key in by user.
let say user key in 3,89,12,6
then all the number will keep in first array.
after that, there are 2 value in second array which same with the first and second value of the first array.
So, the second array will have 3,89
thanks
only have 2 array
first array are key in by user.
let say user key in 3,89,12,6
then all the number will keep in first array.
after that, there are 2 value in second array which same with the first and second value of the first array.
So, the second array will have 3,89
thanks