當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Artists::create方法代碼示例

本文整理匯總了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;
開發者ID:jonathancslynn,項目名稱:1train,代碼行數:31,代碼來源:uploadToDB.php


注:本文中的Artists::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。