首页 > 解决方案 > how to get all values if ID tags from SVG sprite into php array

问题描述

I have svg sprite inserted in html before tag with many svg icons. Each icon inside separate symbol tag.

<symbol id='arrow-right-long' viewBox='0 0 512 512'>
    <path .... />
</symbol>

<symbol id='bars' viewBox='0 0 512 512'>
    <path .... />
</symbol>

Then I output on the page like that

<svg>
    <use xlink:href="#bars"></use>
</svg>

But I want to have one page where I can see all my icons for reference. How to parse svg file and get all values from id tags into php array?

标签: phpfile

解决方案


推荐阅读