Jump to content

nath2098

New Members
  • Posts

    3
  • Joined

  • Last visited

nath2098's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Got it, thanks!
  2. Ahh ok, so a string only... I now have it echo sprintf-ing 'userType':'admin', 'userId': '1' How do I now turn that into an object?
  3. Hi there, I'm sending this: conn.send({"userType":"admin", "userId": <?php echo $_SESSION['userId']; ?>}); and am wondering how to recover it here: public function onMessage(ConnectionInterface $from, $msg) { echo sprintf($msg); foreach($msg AS $key => $value) { echo sprintf($key.": ".$value); } } The echo $msg returns [object Object] (note the lowercase o then uppercase O, what's that about?) and I get an invalid argument in forEach. Cheers!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.