当前位置: 首页>>代码示例>>PHP>>正文


PHP getid3_id3v1::ArrayOfGenres方法代码示例

本文整理汇总了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;
 }
开发者ID:nan0desu,项目名称:xyntach,代码行数:14,代码来源:module.tag.id3v1.php

示例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-';
开发者ID:mayoalexander,项目名称:fl-two,代码行数:31,代码来源:demo.write.php

示例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;
 }
开发者ID:ryumaru,项目名称:ryuzinewriter,代码行数:14,代码来源:module.tag.id3v1.php

示例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());
 }
开发者ID:gravitymedia,项目名称:metadata,代码行数:10,代码来源:Id3v1Test.php


注:本文中的getid3_id3v1::ArrayOfGenres方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。