Jump to main content Jump to doc navigation

xPDOCacheManager::endsWith

Видит, заканчивается ли строка определенным шаблоном или набором шаблонов. Полезно для проверки расширений файлов.

Синтаксис

API Docs: http://api.modxcms.com/xpdo/cache/xPDOCacheManager.html#endsWith

boolean endsWith (string $string, string|array $pattern)

Пример

Проверка, содержит ли файл

$filename = '/my/site/test.flv';
if ($xpdo->cacheManager->endsWith($filename,'flv')) {
  echo 'Ends with flv!";
}

Смотрите также

  1. xPDOCacheManager.copyFile
  2. xPDOCacheManager.copyTree
  3. xPDOCacheManager.delete
  4. xPDOCacheManager.deleteTree
  5. xPDOCacheManager.endsWith
  6. xPDOCacheManager.escapeSingleQuotes
  7. xPDOCacheManager.get
  8. xPDOCacheManager.getCachePath
  9. xPDOCacheManager.getCacheProvider
  10. xPDOCacheManager.matches
  11. xPDOCacheManager.replace
  12. xPDOCacheManager.writeFile
  13. xPDOCacheManager.set
  14. xPDOCacheManager.writeTree
  15. xPDOCacheManager

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • Jens Wittmann – Gestaltung & Entwicklung
  • deJaya
  • Digital Penguin
  • Following Sea
  • YJ
  • Sepia River Studios
  • Dannevang Digital
  • eydolan
  • Nick Clark
  • Lefthandmedia
  • Murray Wood
  • Richard

Budget

$217 per month—let's make that $500!

Learn more