Join Chris Converse for an in-depth discussion in this video Returning a PHP file as an SVG file, part of Design the Web: CSS-Controlled SVG with PHP.
- So as we discussed before, our HTML file here,…with our embedded CSS inside of the style area,…is pointing to these individual SVG graphics.…So what we're going to do now is…take one of these SVG graphics…and convert it to a PHP file.…So let's go back to our project folder.…Let's go inside of our images directory.…Let's find the icon _li, for LinkedIn, .svg.…Now these are just text files,…just like HTML and CSS.…So what I'm going to do first is come in here…and rename this file.…
So we're going to rename it to icon_li…_svg,…and then we're going to put a file extension of .php.…I'm going to hit Return,…your operating system may warn you…that you're changing the file extension.…I'm going to click Use .php,…and the reason we see this warning is that the web server…is now going to treat this file like a PHP file…and not an SVG graphic.…So let's go back to our project.…Let's come up and hit Reload in our browser,…and you'll notice that the graphic now disappears.…
Now there's two things happening here.…One, I'm looking at the local version of my file,…
Share this video
Embed this video
Video: Returning a PHP file as an SVG file