Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!news.bawue.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1378142.Krg0msSpID@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 15 Nov 2012 16:21:18 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Followup-To: comp.lang.php MIME-Version: 1.0 Lines: 50 NNTP-Posting-Date: 15 Nov 2012 16:21:19 CET NNTP-Posting-Host: 7181c699.newsspool1.arcor-online.net X-Trace: DXC=U2C<1Io_o8l<6cDJZfMd_cic==]BZ:afn4Fo<]lROoRankgeX?EC@@`1CEWAg0_HNeDZm8W4\YJNlJ`:FmdeL>K`MbG5PB_J>1ln>nF^_CM4^i X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.php:7574 Shake wrote: > El 15/11/2012 13:26, Dynamo escribió: >> following php code to get the file contents: >> [ >> > $mymenu=file_get_contents('menu.txt'); >> echo $mymenu; >> ?> >> ] >> Everthing works fine but is this good practice and is there a better >> way. > > if the content of 'menu.txt' is HTML... the filename should be > 'menu.html'. And the variable is superfluous (except perhaps for debugging): > What you are doing is an include... you can do this way: > > include('menu.txt'); > ?> That is not equivalent to the above, because with `include' (or `include_once', `require', or `require_once') the content of menu.txt will be parsed (searched for sections which will then be executed). [I had stumbled over that difference while writing a code compactor for ECMAScript-based scripts and Cascading Style-Sheets. It turned out that some of the stylesheets contained ` for details.] PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16