• 09-07-2017, 17:43:12
    #1
    Üyeliği durduruldu
     object(MessageBird\Objects\Message)#48 (16) {
          ["id":protected]=>
          string(32) "4adb1fe375962202d639571b17863457"
          ["href":protected]=>
          string(70) "https://rest.messagebird.com/messages/4adb1fe375962202d639571b17863457"
          ["direction"]=>
          string(2) "mt"
          ["type"]=>
          string(3) "sms"
          ["originator"]=>
          string(6) "DENEME"
          ["body"]=>
          string(6) "test 2"
    Array üstteki gibi hocamlarım aşağıdaki kod ile originator listeliyorum ama ben burada protected bundaki 4adb1fe375962202d639571b17863457
    şu değeri nasıl alabilirim acaba

    foreach ($MessageList->items as $message) 
    	{
    	echo $message->id["originator"];  
    
    	}
  • 10-07-2017, 13:57:41
    #2
    $array = (array)$message;
     $prefix = chr(0).'*'.chr(0);
     echo $array[$prefix.'id'];
    dener misin?
  • 11-07-2017, 11:55:38
    #3
    Üyeliği durduruldu
    nsgnc adlı üyeden alıntı: mesajı görüntüle
    $array = (array)$message;
     $prefix = chr(0).'*'.chr(0);
     echo $array[$prefix.'id'];
    dener misin?
    malesef olmadı hocam
  • 11-07-2017, 12:26:07
    #4
    crawing adlı üyeden alıntı: mesajı görüntüle
    malesef olmadı hocam
    PM attım
  • 11-07-2017, 13:41:23
    #5
    <?php
    class MessageList {
    protected $id = '4adb1fe375962202d639571b17863457';
    }
    $MessageList = new MessageList();

    $r = new ReflectionObject($MessageList);
    $p = $r->getProperty('id');
    $p->setAccessible(true);

    echo $p->getValue($MessageList);

    ?>