View Single Post
  #29  
Unread 02-10-2005, 10:22 PM
taco-man's Avatar
taco-man taco-man is offline
EQ2MAP Updater Author
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 1,349
Default

Quote:
Originally Posted by Eloa
!!!!!!-----EDIT JUST FIGURED THIS OUT-----!!!!!!



I got the neg/pos figured out, the problem im having is with the stripping. I looked up the strip function cause it wasn't working and found that

explode ( string separator, string string [, int limit] )

will work just fine and is less intense on resources.
so this is what I have:
Code:
 function SplitLoc($thisloc){
echo "called";
list($LOC_x, $LOC_z, $LOC_y) = (explode(",",$thisloc));
echo $LOC_x;
}
It will echo the $LOC_x, but only within that function, the variable is NULL outside of it. I still dont quite grasp the way php handles variables, everything else is working sitewide though. But they also are not contained within functions, which is something I dont do. So any advice on this?
Ok your problem is that its inside a function, and since its inside the function the variables declared in it are local
You have 2 options:
1. Make the variables global
2. Return them. I assume you want all 3 or at least more than one of the variables, which means in order to return them you would have to put them into an array first and then return the array.
__________________
EQ2MAP Updater Download
EQ2MAP Website
How to Install a custom interface