Retrieve extension version in php

醉酒当歌 提交于 2019-12-06 17:25:42

问题


Is it possible to get extension version in php?

get_loaded_extensions returns only loaded extentions names, but not versions :(


回答1:


I believe this is what you're looking for:

$version = phpversion("extensionName");

More information




回答2:


At the command line, where extension is the extension name.

php --re extension | head -1

If unsure of the extension name, list extensions with php -m.




回答3:


http://php.net/manual/en/reflectionextension.getversion.php

<?php
    $ext = new ReflectionExtension('mysqli');
    var_dump($ext->getVersion());
?>


来源:https://stackoverflow.com/questions/14626262/retrieve-extension-version-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!