• 05-02-2022, 10:04:29
    #1
    Merhaba arkadaşlar bir array çıktım var ancak içerisinde id değerini arayıp sonuç dönderemiyorum. Her elemanı ayrı ayrı değişkenlere tanımlamak istiyorum. mantık konusunda yardımcı olursanız sevinirim. (R10+)

    stdClass Object
    (
    [users] => Array
    (
    [0] => stdClass Object
    (
    [id] => 1323549139905380353
    [id_str] => 1323549139905380353
    [name] => IBAX Network
    [screen_name] => IbaxNetwork
    [location] => Singapore
    [description] => Airdrop: https://t.co/rqUQqYxMuI
    Discord: https://t.co/mCI9ccRfFE
    Telegram: https://t.co/gEyLE2vItm
    Whitepaper: https://t.co/9tp23ZiIOo
    
    #Cryptocurrency #DAO #Airdrop #Giveaways #NFT #DeFi
    [url] => https://t.co/0AnRK6x7E8
    [entities] => stdClass Object
    (
    [url] => stdClass Object
    (
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/0AnRK6x7E8
    [expanded_url] => http://ibax.io
    [display_url] => ibax.io
    [indices] => Array
    (
    [0] => 0
    [1] => 23
    )
    
    )
    
    )
    
    )
    
    [description] => stdClass Object
    (
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/rqUQqYxMuI
    [expanded_url] => http://ibax.io/login
    [display_url] => ibax.io/login
    [indices] => Array
    (
    [0] => 9
    [1] => 32
    )
    
    )
    
    [1] => stdClass Object
    (
    [url] => https://t.co/mCI9ccRfFE
    [expanded_url] => http://discord.gg/zRX6Mwafya
    [display_url] => discord.gg/zRX6Mwafya
    [indices] => Array
    (
    [0] => 42
    [1] => 65
    )
    
    )
    
    [2] => stdClass Object
    (
    [url] => https://t.co/gEyLE2vItm
    [expanded_url] => http://t.me/IBAXNetwork
    [display_url] => t.me/IBAXNetwork
    [indices] => Array
    (
    [0] => 76
    [1] => 99
    )
    
    )
    
    [3] => stdClass Object
    (
    [url] => https://t.co/9tp23ZiIOo
    [expanded_url] => http://bit.ly/3pZHrj4
    [display_url] => bit.ly/3pZHrj4
    [indices] => Array
    (
    [0] => 112
    [1] => 135
    )
    
    )
    
    )
    
    )
    
    )
    
    [protected] =>
    [followers_count] => 82825
    [friends_count] => 213[listed_count] => 40
    [created_at] => Tue Nov 03 08:54:57 +0000 2020
    [favourites_count] => 266
    [utc_offset] =>
    [time_zone] =>
    [geo_enabled] =>
    [verified] =>
    [statuses_count] => 612
    [lang] =>
    [status] => stdClass Object
    (
    [created_at] => Fri Feb 04 18:40:13 +0000 2022
    [id] => 1489670144804548610
    [id_str] => 1489670144804548610
    [text] => Never tried cyber violence, #IBAX communities let's try to report it and take out the scammer's account!
    
    https://t.co/8K27KO4FIV
    [truncated] =>
    [entities] => stdClass Object
    (
    [hashtags] => Array
    (
    [0] => stdClass Object
    (
    [text] => IBAX
    [indices] => Array
    (
    [0] => 28
    [1] => 33
    )
    
    )
    
    )
    
    [symbols] => Array
    (
    )
    
    [user_mentions] => Array
    (
    )
    
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/8K27KO4FIV
    [expanded_url] => https://twitter.com/nc2u1965/status/1489623917383802881?t=jLK06lIS0avfaYTecn48Fw&s=19
    [display_url] => twitter.com/nc2u1965/statu…
    [indices] => Array
    (
    [0] => 106
    [1] => 129
    )
    
    )
    
    )
    
    )
    
    [source] => [URL="https://mobile.twitter.com/"]Twitter Web App[/URL]
    [in_reply_to_status_id] =>
    [in_reply_to_status_id_str] =>
    [in_reply_to_user_id] =>
    [in_reply_to_user_id_str] =>
    [in_reply_to_screen_name] =>
    [geo] =>
    [coordinates] =>
    [place] =>
    [contributors] =>
    [is_quote_status] => 1
    [retweet_count] => 22
    [favorite_count] => 58
    [favorited] =>
    [retweeted] =>
    [possibly_sensitive] =>
    [lang] => en
    )
    
    [contributors_enabled] =>
    [is_translator] =>
    [is_translation_enabled] =>
    [profile_background_color] => F5F8FA
    [profile_background_image_url] =>
    [profile_background_image_url_https] =>
    [profile_background_tile] =>
    [profile_image_url] => [url]http://pbs.twimg.com/profile_images/1348572400871378948/BJb5WhHq_normal.jpg[/url]
    [profile_image_url_https] => [url]https://pbs.twimg.com/profile_images/1348572400871378948/BJb5WhHq_normal.jpg[/url]
    [profile_banner_url] => [url]https://pbs.twimg.com/profile_banners/1323549139905380353/1634618111[/url]
    [profile_link_color] => 1DA1F2
    [profile_sidebar_border_color] => C0DEED
    [profile_sidebar_fill_color] => DDEEF6
    [profile_text_color] => 333333
    [profile_use_background_image] => 1
    [has_extended_profile] => 1
    [default_profile] => 1
    [default_profile_image] =>
    [following] => 1
    [live_following] =>
    [follow_request_sent] =>
    [notifications] =>
    [muting] =>
    [blocking] =>
    [blocked_by] =>
    [translator_type] => none
    [withheld_in_countries] => Array
    (
    )
    
                    )
  • 05-02-2022, 10:09:13
    #2
    array filter yapacaksın filter
  • 05-02-2022, 10:15:11
    #3
    gurbuzemre adlı üyeden alıntı: mesajı görüntüle
    array filter yapacaksın filter
    iç içe dizilerde çalışmıyor diye okumuştum. yapmak istediğim şey aslında tam da şu.
    id yi tüm satırlarda sorgulayıp varsa 1 yoksa 0 demek istiyorum. Mümkün mü yani filter ile.
  • 05-02-2022, 10:17:58
    #4
    Arifap adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar bir array çıktım var ancak içerisinde id değerini arayıp sonuç dönderemiyorum. Her elemanı ayrı ayrı değişkenlere tanımlamak istiyorum. mantık konusunda yardımcı olursanız sevinirim. (R10+)

    stdClass Object
    (
    [users] => Array
    (
    [0] => stdClass Object
    (
    [id] => 1323549139905380353
    [id_str] => 1323549139905380353
    [name] => IBAX Network
    [screen_name] => IbaxNetwork
    [location] => Singapore
    [description] => Airdrop: https://t.co/rqUQqYxMuI
    Discord: https://t.co/mCI9ccRfFE
    Telegram: https://t.co/gEyLE2vItm
    Whitepaper: https://t.co/9tp23ZiIOo
    
    #Cryptocurrency #DAO #Airdrop #Giveaways #NFT #DeFi
    [url] => https://t.co/0AnRK6x7E8
    [entities] => stdClass Object
    (
    [url] => stdClass Object
    (
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/0AnRK6x7E8
    [expanded_url] => http://ibax.io
    [display_url] => ibax.io
    [indices] => Array
    (
    [0] => 0
    [1] => 23
    )
    
    )
    
    )
    
    )
    
    [description] => stdClass Object
    (
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/rqUQqYxMuI
    [expanded_url] => http://ibax.io/login
    [display_url] => ibax.io/login
    [indices] => Array
    (
    [0] => 9
    [1] => 32
    )
    
    )
    
    [1] => stdClass Object
    (
    [url] => https://t.co/mCI9ccRfFE
    [expanded_url] => http://discord.gg/zRX6Mwafya
    [display_url] => discord.gg/zRX6Mwafya
    [indices] => Array
    (
    [0] => 42
    [1] => 65
    )
    
    )
    
    [2] => stdClass Object
    (
    [url] => https://t.co/gEyLE2vItm
    [expanded_url] => http://t.me/IBAXNetwork
    [display_url] => t.me/IBAXNetwork
    [indices] => Array
    (
    [0] => 76
    [1] => 99
    )
    
    )
    
    [3] => stdClass Object
    (
    [url] => https://t.co/9tp23ZiIOo
    [expanded_url] => http://bit.ly/3pZHrj4
    [display_url] => bit.ly/3pZHrj4
    [indices] => Array
    (
    [0] => 112
    [1] => 135
    )
    
    )
    
    )
    
    )
    
    )
    
    [protected] =>
    [followers_count] => 82825
    [friends_count] => 213[listed_count] => 40
    [created_at] => Tue Nov 03 08:54:57 +0000 2020
    [favourites_count] => 266
    [utc_offset] =>
    [time_zone] =>
    [geo_enabled] =>
    [verified] =>
    [statuses_count] => 612
    [lang] =>
    [status] => stdClass Object
    (
    [created_at] => Fri Feb 04 18:40:13 +0000 2022
    [id] => 1489670144804548610
    [id_str] => 1489670144804548610
    [text] => Never tried cyber violence, #IBAX communities let's try to report it and take out the scammer's account!
    
    https://t.co/8K27KO4FIV
    [truncated] =>
    [entities] => stdClass Object
    (
    [hashtags] => Array
    (
    [0] => stdClass Object
    (
    [text] => IBAX
    [indices] => Array
    (
    [0] => 28
    [1] => 33
    )
    
    )
    
    )
    
    [symbols] => Array
    (
    )
    
    [user_mentions] => Array
    (
    )
    
    [urls] => Array
    (
    [0] => stdClass Object
    (
    [url] => https://t.co/8K27KO4FIV
    [expanded_url] => https://twitter.com/nc2u1965/status/1489623917383802881?t=jLK06lIS0avfaYTecn48Fw&s=19
    [display_url] => twitter.com/nc2u1965/statu…
    [indices] => Array
    (
    [0] => 106
    [1] => 129
    )
    
    )
    
    )
    
    )
    
    [source] => [URL="https://mobile.twitter.com/"]Twitter Web App[/URL]
    [in_reply_to_status_id] =>
    [in_reply_to_status_id_str] =>
    [in_reply_to_user_id] =>
    [in_reply_to_user_id_str] =>
    [in_reply_to_screen_name] =>
    [geo] =>
    [coordinates] =>
    [place] =>
    [contributors] =>
    [is_quote_status] => 1
    [retweet_count] => 22
    [favorite_count] => 58
    [favorited] =>
    [retweeted] =>
    [possibly_sensitive] =>
    [lang] => en
    )
    
    [contributors_enabled] =>
    [is_translator] =>
    [is_translation_enabled] =>
    [profile_background_color] => F5F8FA
    [profile_background_image_url] =>
    [profile_background_image_url_https] =>
    [profile_background_tile] =>
    [profile_image_url] => [url]http://pbs.twimg.com/profile_images/1348572400871378948/BJb5WhHq_normal.jpg[/url]
    [profile_image_url_https] => [url]https://pbs.twimg.com/profile_images/1348572400871378948/BJb5WhHq_normal.jpg[/url]
    [profile_banner_url] => [url]https://pbs.twimg.com/profile_banners/1323549139905380353/1634618111[/url]
    [profile_link_color] => 1DA1F2
    [profile_sidebar_border_color] => C0DEED
    [profile_sidebar_fill_color] => DDEEF6
    [profile_text_color] => 333333
    [profile_use_background_image] => 1
    [has_extended_profile] => 1
    [default_profile] => 1
    [default_profile_image] =>
    [following] => 1
    [live_following] =>
    [follow_request_sent] =>
    [notifications] =>
    [muting] =>
    [blocking] =>
    [blocked_by] =>
    [translator_type] => none
    [withheld_in_countries] => Array
    (
    )
    
                    )
    dizideki her elemanı ayrı değişkenlere almak istiyorsanız
    https://www.php.net/manual/tr/function.extract.php
    extract kullanacaksınız sadece değişken isimlerine dikkat edin eğer iki dizi içindede id geçiyorsa EXTR_PREFIX_ALL ile kullanacaksınız diğer değişkenlerden ayırmak için.
    örnek :
    <?php
    
    $dizi1 = ["id" => 1, "isim" => "abc"];
    
    $dizi2 = ["id" => 22, "isim" => "def"];
    
    extract($dizi1, EXTR_PREFIX_ALL, "a");
    
    extract($dizi2, EXTR_PREFIX_ALL,"b");
    
    echo $a_id . "<br>";
    echo $b_id . "<br>";
  • 05-02-2022, 10:19:16
    #5
    Arifap adlı üyeden alıntı: mesajı görüntüle
    iç içe dizilerde çalışmıyor diye okumuştum. yapmak istediğim şey aslında tam da şu.
    id yi tüm satırlarda sorgulayıp varsa 1 yoksa 0 demek istiyorum. Mümkün mü yani filter ile.
    in_array var onun içinde biraz araştırırsan php dökümantasyon sayfasını aradığını bulursun hocam
  • 05-02-2022, 11:14:49
    #6
    yok sonuç alamadım. Bir yeri atlıyorum ya da yanlış tanımlıyorum.