English 中文(简体)
Soundcloud API PHP 整合
原标题:Soundcloud API PHP Integration

我目前正在尝试将音频库的音轨流到新的网络应用程序。 目前我能够获得相册封面, 但现在我需要获得用户名、 音轨标题和 permalink, 才能在相册封面下出现。 这是我到目前为止的代码 。

<body onload="setupBlocks();">

<?php 
    if(isset($tracks)){
        foreach($tracks as $track){
            debug($track[ stream_url ]);
            debug($track[ artist ]);

            echo  <div class="block"> ;
            echo "<p><img src= ".$track[ artwork_url ]."  width= 275  height= 125  /></p>";

我是否只需要做另一个回声语句 echo "<p><src= ".$track[标题]"。 / & gt;</p> "; ?

... 并遵循用户名和 permalink 相同的回声语句格式?

最佳回答

yup. 如果您已经拥有音轨资源, 您可以访问所有您需要的信息。 只要发布一些更多回声语句, 如以下 :

echo $track[ title ];
echo $track[ user ][ username ];
echo $track[ permalink_url ];

如果您想要查看所有可用的字段, 您可以尝试以下调试语句 :

print_r($track);

希望有帮助!

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签