Morgan Green Morgan Green - 2 years ago 120
CSS Question

Create New Line in Source

I'm trying to dynamically load CSS, JS and other parts and what I'm running into is a little bit of a mess. This doesn't affect functionality as much as I don't like what I see when I view source.
My Source when I view it is as such
enter image description here

You can see that it's there. It works, but man is that messy!
What I'd like it to do is have a new line between each source, the code that I use to pull this information is

function LoadTheme($argument) {
switch($argument) {
case "active":
$theme = Frontend; break;
default: $theme = $argument; break;
$configFile = "config.json";
$configPath = frontend.'/'.$theme.'/'.$configFile;
$themePath = frontend.'/'.$theme.'/';
if(file_exists($configPath)) {
else {
echo "Fatal Error. No theme Configuration Found";
function LoadThemeIncludes($configPath,$themePath) {
$string = file_get_contents($configPath);
$json_a = json_decode($string, true);
$stylesheets = $themePath.''.$json_a['includes']['css'].'/*.css';
foreach(glob($stylesheets) as $stylesheet) {
echo '<link rel="stylesheet" type="text/css" href="'.ConvertURL($stylesheet).'" media="screen" />';

function ConvertURL($path) {
$cv = str_replace(public_p, $_SERVER['HTTP_HOST'], $path);
return $cv;

And the config file that I use is a json file formatted as such:

"details": {
"author": "Morgan Green",
"details": "Revelio Theme",
"lastUpdate": "6/17/2016"
"includes": {
"parts": "parts",
"script": "jscript",
"css": "css",
"fonts": "fonts",
"images": "images",
"templates": "templates",
"functions": "functions.d"
"options": {
"layout": "mod_right"

What I want to accomplish is when a user views the source they don't just see it wrapping like the picture has, but rather
the source would have a new line after each one.

Answer Source

To print a new line:

echo PHP_EOL;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download