本文整理汇总了PHP中Artists::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Artists::create方法的具体用法?PHP Artists::create怎么用?PHP Artists::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Artists
的用法示例。
在下文中一共展示了Artists::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
<?php
require_once '1trainSongs.php';
require_once '1trainArtists.php';
require_once '1trainUsers.php';
$songid = $_REQUEST['id'];
$artistid = $_REQUEST['user_id'];
$title = $_REQUEST['title'];
$artist = $_REQUEST['user']['username'];
$art = $_REQUEST['artwork_url'];
$avatar = $_REQUEST['user']['avatar_url'];
$user_id = $_REQUEST['whoLikedID'];
$profile = $_REQUEST['whoLiked'];
Artists::create($artistid, $artist);
Users::create($user_id, $profile);
if ($art == "") {
$avatar = explode("large", $avatar)[0] . "crop.jpg";
//gets a higher quality image
Songs::create($songid, $title, $artistid, $avatar, $user_id);
} elseif ($art == "https://sndcdn.com/images/default_avatar_crop.jpg") {
//if no song art or user avatar
$art = "photoshop/carousel-headphones-black-red.png";
Songs::create($songid, $title, $artistid, $art, $user_id);
} else {
$art = explode("large", $art)[0] . "crop.jpg";
//gets a higher quality image
Songs::create($songid, $title, $artistid, $art, $user_id);
}
header('Content-type: application/json');
print "success from uploadToDB";
exit;