开发者

print_r returning full text [closed]

开发者 https://www.devze.com 2022-12-07 22:30 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add d开发者_C百科etails and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add d开发者_C百科etails and clarify the problem by editing this post.

Closed 10 hours ago.

Improve this question

I am using this snippet on my WordPress website `

    $value = get_post_meta( get_the_ID(), "_lottery_instant_ticket_numbers_prizes", true );
    print_r($value);

This is returning the following: Array ( [1] => Array ( [ticket] => 31 [prize] => £35 ) [2] => Array ( [ticket] => 74 [prize] => £35 ) [3] => Array ( [ticket] => 88 [prize] => £35 ) )

May you please let me know what should be done to display the results in a good appealing way, without the word "array" and the arrows? My idea is to make a table maybe or anything to display data from the metadata of the post/product `

I only tried what I typed above


as ADyson suggested, echo $value[2]["ticket"]; is the answer, it worked. Thank you so much for giving me a hand!

0

精彩评论

暂无评论...
验证码 换一张
取 消