src/arraytopath/arraytopath.class.php
public function set_data($path, $data) {
		if(is_object($data)) {
			throw new InvalidArgumentException("objects are not supported");
		}
		else {
			//get the list of indices in the session that we have to traverse.
			$myIndexList = $this->explode_path($path);

			$retval = 0;
			//Use an internal iterator to go through the little bits of the session & set the
			//	data where it's supposed to be.
			if($path === '/' || count($myIndexList) == 0) {
				//setting the data.
				$this->data = $data;
				$retval = 1;
			}
			elseif(count($myIndexList) == 1) {
				//that should be simple: set the index to be $data.
				if(!is_array($this->data)) {
					$this->data = array();
				}
				$this->data[$myIndexList[0]] = $data;
				$retval = 1;
			}
			elseif(count($myIndexList) > 1) {
				$this->internal_iterator($this->data, $path, $data);
				$retval = 1;
			}
		}
		
		return($retval);
	}
public function set_data($path, $data) {
		if(is_object($data)) {
			throw new InvalidArgumentException("objects are not supported");
		}
		else {
			//get the list of indices in the session that we have to traverse.
			$myIndexList = $this->explode_path($path);

			$retval = 0;
			//Use an internal iterator to go through the little bits of the session & set the
			//	data where it's supposed to be.
			if($path === '/' || count($myIndexList) == 0) {
				//setting the data.
				$this->data = $data;
				$retval = 1;
			}
			elseif(count($myIndexList) == 1) {
				//that should be simple: set the index to be $data.
				if(!is_array($this->data)) {
					$this->data = array();
				}
				$this->data[$myIndexList[0]] = $data;
				$retval = 1;
			}
			elseif(count($myIndexList) > 1) {
				$this->internal_iterator($this->data, $path, $data);
				$retval = 1;
			}
		}
		
		return($retval);
	}
public function set_data ( $ path , $ data ) { if ( is_object ( $ data ) ) { throw new InvalidArgumentException ( "objects are not supported" ) ; } else { //get the list of indices in the session that we have to traverse. $ myIndexList = $ this -> explode_path ( $ path ) ; $ retval = 0 ; //Use an internal iterator to go through the little bits of the session & set the //	data where it's supposed to be. if ( $ path === '/' || count ( $ myIndexList ) == 0 ) { //setting the data. $ this -> data = $ data ; $ retval = 1 ; } elseif ( count ( $ myIndexList ) == 1 ) { //that should be simple: set the index to be $data. if ( ! is_array ( $ this -> data ) ) { $ this -> data = array ( ) ; } $ this -> data [ $ myIndexList [ 0 ] ] = $ data ; $ retval = 1 ; } elseif ( count ( $ myIndexList ) > 1 ) { $ this -> internal_iterator ( $ this -> data , $ path , $ data ) ; $ retval = 1 ; } } return ( $ retval ) ; }
Sets data into the given path, with options to override our internal prefix, and to
force-overwrite data if it's not an array.

@param $path				<str> path to set the data into.
@param $data				<mixed> what to set into the given path.

@return 0				FAIL: old data doesn't match new data.
@return 1				PASS: everything lines-up.
Sets data into the given path with options to override our internal prefix and to force - overwrite data if it s not an array .