本文整理汇总了PHP中getid3_id3v1::ArrayOfGenres方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_id3v1::ArrayOfGenres方法的具体用法?PHP getid3_id3v1::ArrayOfGenres怎么用?PHP getid3_id3v1::ArrayOfGenres使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类getid3_id3v1
的用法示例。
在下文中一共展示了getid3_id3v1::ArrayOfGenres方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LookupGenreID
function LookupGenreID($genre, $allowSCMPXextended = false)
{
$GenreLookup = getid3_id3v1::ArrayOfGenres($allowSCMPXextended);
$LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre));
foreach ($GenreLookup as $key => $value) {
foreach ($GenreLookup as $key => $value) {
if (strtolower(str_replace(' ', '', $value)) == $LowerCaseNoSpaceSearchTerm) {
return $key;
}
}
return false;
}
return isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false;
}
示例2: elseif
} elseif (!empty($OldThisFileInfo['comments']['track']) && is_array($OldThisFileInfo['comments']['track'])) {
$RawTrackNumberArray = $OldThisFileInfo['comments']['track'];
} else {
$RawTrackNumberArray = array();
}
foreach ($RawTrackNumberArray as $key => $value) {
if (strlen($value) > strlen($TrackNumber)) {
// ID3v1 may store track as "3" but ID3v2/APE would store as "03/16"
$TrackNumber = $value;
}
}
if (strstr($TrackNumber, '/')) {
list($TrackNumber, $TracksTotal) = explode('/', $TrackNumber);
}
echo '<tr><td align="right"><b>Track</b></td><td><input type="text" size="2" name="Track" value="' . htmlentities($TrackNumber, ENT_QUOTES) . '"> of <input type="text" size="2" name="TracksTotal" value="' . htmlentities($TracksTotal, ENT_QUOTES) . '"></TD></TR>';
$ArrayOfGenresTemp = getid3_id3v1::ArrayOfGenres();
// get the array of genres
foreach ($ArrayOfGenresTemp as $key => $value) {
// change keys to match displayed value
$ArrayOfGenres[$value] = $value;
}
unset($ArrayOfGenresTemp);
// remove temporary array
unset($ArrayOfGenres['Cover']);
// take off these special cases
unset($ArrayOfGenres['Remix']);
unset($ArrayOfGenres['Unknown']);
$ArrayOfGenres[''] = '- Unknown -';
// Add special cases back in with renamed key/value
$ArrayOfGenres['Cover'] = '-Cover-';
$ArrayOfGenres['Remix'] = '-Remix-';
示例3: LookupGenreID
public static function LookupGenreID($genre, $allow_SCMPX_extended = false)
{
$lookup = getid3_id3v1::ArrayOfGenres($allow_SCMPX_extended);
$lower_case_no_space_search_term = strtolower(str_replace(' ', '', $genre));
foreach ($lookup as $key => $value) {
foreach ($lookup as $key => $value) {
if (strtolower(str_replace(' ', '', $value)) == $lower_case_no_space_search_term) {
return $key;
}
}
return false;
}
return isset($lookup[$genre_id]) ? $lookup[$genre_id] : false;
}
示例4: testShouldWriteAndReadGenre
/**
* @covers \GravityMedia\Metadata\Tag\Id3v1::getGenre
*/
public function testShouldWriteAndReadGenre()
{
$availableGenres = array_values(Id3v1Processor::ArrayOfGenres());
$expected = $availableGenres[array_rand($availableGenres)];
$this->file->getMetadata()->getId3v1Tag()->setGenre($expected)->save();
$this->assertEquals($expected, $this->file->getMetadata()->getId3v1Tag()->getGenre());
}