Page 1 of 1

Problem inserting string into array

Posted: Fri Apr 22, 2011 7:20 am
by tycoon79
Hi..i'm trying to insert an implode generated string to an array that then later be used for json implementation

the implode generated string is look like this

Code: Select all

    'id' => $this->_SqlResult[0],'UserId' => $this->_SqlResult[1],'Msg' => $this->_SqlResult[2],'MsgStamp' => $this->_SqlResult[3]
i would like to used it in this code

Code: Select all

 $this->_JsonArr[]=array($Generated string);
to achieve something like this

Code: Select all

  $this->_JsonArr[]=array('id' => $this->_SqlResult[0],'UserId' => $this->_SqlResult[1],'Msg' => $this->_SqlResult[2],'MsgStamp' => $this->_SqlResult[3]);
instead i got something like this

Code: Select all

  $this->_JsonArr[]=array(" 'id' => $this->_SqlResult[0],'UserId' => $this->_SqlResult[1],'Msg' => $this->_SqlResult[2],'MsgStamp' => $this->_SqlResult[3]");

seem like generated string is treated as one element as key and value pair.
obviously i can get expected output from mysql because of this, can anybody help me with this