why do so many people use echo etc in there php code for lines that dont require this, surley this is just more load on the server why not just use basic html this was the server dosnt do the rendering instead the browser does it therefore reducing load on server am i right people?
php
Collapse
X
-
Yes. but you lessin the echo then it will be okVisit: Chat4u.mobi - The New Lay Of being a site of your dreams!
Visit: WapMasterz Coming Back Soon!
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
-
You mean like this?PHP Code:<?php
echo "<html><body>";
some php here
echo "</body></html>";
?>
PHP Code:<html><body>
<?php some php here ?>
</body></html>My Blog: http://jhommark.blogspot.com
My Facebook: http://www.facebook.com/jhommark
My Official Site: http://www.undergroundweb.tk
My Community Site: http://undergroundwap.xtreemhost.com
Comment
-
She said: <?echo $she;?> !<br/>
<? if ($answer == "yes") { $he = "me too"; } else { $he = "oh sh!t"; } ?> He answered: <?echo $he;?>!<br/>
Why all this? Server will say: Please, why me?mysterio.al - programming is a functional art
Comment
-
Originally posted by mobileGIGS View PostEcho statements r d least things to give performance boost wen optimizing ur php software / script. Pay attention to simple coding rules and u'll be okay. Maybe we should discuss these rules sumtime.
but yes going back i dont see the point why
echo "sitename : $sitename"; when it would be better to do it as this
sitename : <? print($sitename) ?>
therfore only making conttact to the server when needed. the rest would just be html and not in echo " ";
Comment
-
you right mobileGIGS, i wrote it horrible to tell that not all time mixing php and html is good.mysterio.al - programming is a functional art
Comment
-
theres a number of simple things you can do, most of which wont make much difference unless you run time test scripts (these are fundamentality there to expose a flaw in a design and very rarely would you ever meet the conditions in a timed test, and timed tests depend on more things that just the raw code so ideally they should be performed 100's of times for accurate results ina randomised order).
Anyhows if your that interested,
use echo not print
use fetch_assoc or fetch_row not array, this creates duplicate data in RAM
use ternary statements where applicable NOT if conditions, such as when settings up dynamics in a text string for example
echo 'welcome '.(isset($user) ? $user['name'] : 'Guest').', please enjoy your stay';
use single quotes not double quotes when echoing anything that you dont need to input variables into
Only break out of PHP for worthy lengths of code, making the interpreter mess around searching for tags that are next to each other really isnt nice just to get it to skip 2 or 3 html tags
Learn to use a god damn switch, elseif's going down 100's of lines just aint good coding
Comment
-
But i like else if {wara wara} else {wara some more} is that so wrong to do.BakGat
Code:class Counter { public: void Count(); int ReadDisplay(); private: int CurrentCount; };
Back up my hard drive? How do I put it in reverse?My Community
BakGat
sigpic
Comment
-
using switch case and else if wont make difference at all
check this http://www.php.lt/benchmark/phpbench.php
Comment
-
So I can use 100's of switches and else if and it will have no impact on the speed.BakGat
Code:class Counter { public: void Count(); int ReadDisplay(); private: int CurrentCount; };
Back up my hard drive? How do I put it in reverse?My Community
BakGat
sigpic
Comment
Comment