The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How do I explode, do something, implode?
Let's say I have an array:
$array = "50,60,70,80,90"; And I want to take each element of the array and do something with it. The specific something is a mathmatical operation; let's say I want to subtract 10 from each number. Then, after subracting 10 from each number, I want so put all the results back into a new array. The new array would look like "40,50,60,70,80". How do I write this? I know to start with something like: $exploded_array = explode(",",$array) But where do I go from there? (And in the explode(), does $array need to be enclosed in quotes or not?) |
#2
|
||||
|
||||
PHP Code:
PHP Code:
|
#3
|
||||
|
||||
Chen I forget but why do you add a & to the front of a variable in certain cases?
|
#4
|
||||
|
||||
Thanks!
|
#5
|
||||
|
||||
Quote:
http://php.fastmirror.com/manual/en/...references.php |
#6
|
||||
|
||||
Thanks for the help as always.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|