RE: [PHP] Why are my style sheets all listed on one line?

From: Date: Fri, 30 Jan 2004 09:57:49 +0000
Subject: RE: [PHP] Why are my style sheets all listed on one line?
Groups: php.general 
Request: Send a blank email to php-general+get-176319@lists.php.net to get a copy of this message
On 30 January 2004 08:55, Freedomware wrote: > David Obrien wrote: > > > You need a \n at the end of each line inside the quote like > > echo "<stylesheet>\n"; > > > > \n is newline > > -Dave Another way you could go, as this is mostly HTML with some PHP values thrown in, is to write it as such -- then all your newlines are present exactly as they appear. This would look something like: <?php $todayDate = date("m-d-Y"); ?> <title>Freedomware &gt; <?php echo $myname ?></title> <meta name="description" content="<?php echo $myname ?> versus Microsoft" /> <meta name="keywords" content="<?php echo $myname ?> versus Microsoft" /> <meta name="mssmarttagspreventparsing" content="true" /> <meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="David Blomstrom" /> <script src="<?php echo $periods ?>js/swapclass.js" type="text/javascript"></script> <script language="JavaScript" src="<?php echo $periods ?>js/sort.js"></script>' <script language="JavaScript" src="<?php echo $periods ?>js/ss.js"></script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <link href="<?php echo $periods ?>css/ref.css" rel="stylesheet" type="text/css"> <?php if($includea1){ ?> <link href="<?php echo $periods ?>css/<?php echo $continentcode ?>/a1.css" rel="stylesheet" type="text/css" /> <?php } ?> <link href="<?php echo $mycss ?>.css" rel="stylesheet" type="text/css" /> echo '<link href="' . $periods . etc. etc. By the way, the test if($includea1 == TRUE) should be written as just if($includea1) It has exactly the same outcome, but is both more readable (if you've named your variables suitably) and more efficient (since you've saved the redundant comparison operation). Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#176319) next »