-1

i am trying to get the contents of another class object into php code. a class object contains

$Raiwind = new gridcell();
$Raiwind->place="raiwind";
$Raiwind->latitude="31.4279";
$Raiwind->spatial[] = array(
    array('lda','31.4104',3),
    array('ali','31.3998',3),
    array('multan','31.4675',10));
$Raiwind->temporal[]=array(
    array('lda',00.04),
    array('ali',00.06),
    array('multan',00.26),
    array('dha',00.33));
$Raiwind->taxi=array(array(8899, 15.56)); 

now in another web page i am trying to get the taxi array contents matched with $raiwind. how to code that.

Jonan
  • 2,485
  • 3
  • 24
  • 42

1 Answers1

0

Store the object in session. I give you a link if you don't know how to do this.

Exemple:

//start session
session_start();

$obj = new Object(...);
//do something
$_SESSION['object']= $obj;

Now your have your object in session, and you can use it everywere in your application. You can also serialise the object for pass it in GET or POST. Same problem

Community
  • 1
  • 1
Julien Leray
  • 1,647
  • 2
  • 18
  • 34
  • [Link-only answers are discouraged on Stack Overflow](http://meta.stackexchange.com/questions/65277/are-link-only-answers-poor-practice). Please copy the relevant information into your answer. – ChrisGPT was on strike Apr 16 '14 at 12:50
  • I can, but he can also click on the link and they will be the same information... I don't understand why you say that... :/ – Julien Leray Apr 16 '14 at 12:55
  • It's thoroughly discussed in the link I included, but the core problem boils down to this: (a) Stack Overflow answers should be useful to other people in the future who have the same problem. (b) The link may go dead. (c) If it does, your answer becomes useless. – ChrisGPT was on strike Apr 16 '14 at 12:57
  • 1
    Ha, ok, I had not thought of that (dead link). – Julien Leray Apr 16 '14 at 12:59