一看到这种程序就想抽写这种代码的人
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> if($server > 0) { if(empty($dblist)) { $dbs = mysql_list_dbs(); $num_dbs = mysql_numrows($dbs); } else { $num_dbs = count($dblist); } for($i=0; $i <div id="el<?php echo $j;?>Parent" class="parent"> <a class="item" href="db_details.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>" onclick="expandIt('el<?php echo $j;?>'); return false;"> <img src="/static/imghwm/default1.png" data-src="images/plus.gif" class="lazy" name="imEx" border="0" alt="+" style="max-width:90%" style="max-width:90%" id="el<?php echo $j;?>Img"></a> <a class="item" href="db_details.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>" onclick="expandIt('el<?php echo $j;?>');"> <font color="black" class="heada"> <?php echo $db;?> </font></a> </div> <div id="el<?php echo $j;?>Child" class="child"> <?php $tables = mysql_list_tables($db); $num_tables = @mysql_numrows($tables); for($j=0; $j<$num_tables; $j++) { $table = mysql_tablename($tables, $j); ?> <nobr> <a target="phpmain" href="sql.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>&table=<?php%20echo%20urlencode(%24table);?>&sql_query=<?php%20echo%20urlencode(" select from>&pos=0&goto=tbl_properties.php"><img src="/static/imghwm/default1.png" data-src="images/browse.gif" class="lazy" border="0" alt="<?php echo $strBrowse." :>"></a> <a class="item" target="phpmain" href="tbl_properties.php?server=<?php%20echo%20%24server;?>&db=<?php%20echo%20%24db;?>&table=<?php%20echo%20urlencode(%24table);?>"><?php echo $table;?></a></nobr><br> <?php
要是随便给他改几个地方,不知道他自己能不能改好。
------解决方案--------------------
麻花代码 看起来就不爽
------解决方案--------------------
改一次麻烦一次,就这点?重写
------解决方案--------------------
这样的代码看起来比较乱,后期维护比较麻烦
------解决方案--------------------
别抽我,我写过.而且一写还写了好些年
------解决方案--------------------
我一直都是html和php分开写的
------解决方案--------------------
------解决方案--------------------
全都是php tag & echo
应该是早期代码了
在2005年左右,这种代码风格最流行了
------解决方案--------------------
这样写的乱,看不出层次结构
如果把HTML和后台写在一起的话,就全用后台输出
这样结构清楚,后台解释输出也快
------解决方案--------------------
编码规范很重要滴
------解决方案--------------------
咳咳,
虽然说的确这样的代码不算好....不过, 如果你看到这样的代码就要抽人的话, 那你可抽的人多了...我也难逃厄运啊....
随便挑几个有点历史的开源php软件都能看到这样的代码.....
在OO被引进php之前,在smarty等模板流行之前,php就是这样的...
而且,在那个时候,这是作为一个"进步", 相对于perl等老式web编程需要大段大段输出的方式

TheSecretTokeEpingAphp-PowerEdwebSiterUnningSmoothlyShyunderHeavyLoadInVolvOLVOLVOLDEVERSALKEYSTRATICES:1)emplactopCodeCachingWithOpcachingWithOpCacheToreCescriptexecution Time,2)使用atabasequercachingCachingCachingWithRedataBasEndataBaseLeSendataBaseLoad,3)

你應該關心DependencyInjection(DI),因為它能讓你的代碼更清晰、更易維護。 1)DI通過解耦類,使其更模塊化,2)提高了測試的便捷性和代碼的靈活性,3)使用DI容器可以管理複雜的依賴關係,但要注意性能影響和循環依賴問題,4)最佳實踐是依賴於抽象接口,實現鬆散耦合。

是的,優化papplicationispossibleandessential.1)empartcachingingcachingusedapcutorediucedsatabaseload.2)優化的atabaseswithexing,高效Quereteries,and ConconnectionPooling.3)EnhanceCodeWithBuilt-unctions,避免使用,避免使用ingglobalalairaiables,並避免使用

theKeyStrategiestosigantificallyBoostPhpaPplicationPerformenCeare:1)UseOpCodeCachingLikeLikeLikeLikeLikeCacheToreDuceExecutiontime,2)優化AtabaseInteractionswithPreparedStateTementStatementStatementAndProperIndexing,3)配置

aphpdepentioncontiveContainerIsatoolThatManagesClassDeptions,增強codemodocultion,可驗證性和Maintainability.itactsasaceCentralHubForeatingingIndections,因此reducingTightCightTightCoupOulplingIndeSingantInting。

選擇DependencyInjection(DI)用於大型應用,ServiceLocator適合小型項目或原型。 1)DI通過構造函數注入依賴,提高代碼的測試性和模塊化。 2)ServiceLocator通過中心註冊獲取服務,方便但可能導致代碼耦合度增加。

phpapplicationscanbeoptimizedForsPeedAndeffificeby:1)啟用cacheInphp.ini,2)使用preparedStatatementSwithPdoforDatabasequesies,3)3)替換loopswitharray_filtaray_filteraray_maparray_mapfordataprocrocessing,4)conformentnginxasaseproxy,5)

phpemailvalidation invoLvesthreesteps:1)格式化進行regulareXpressecthemailFormat; 2)dnsvalidationtoshethedomainhasavalidmxrecord; 3)


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境

記事本++7.3.1
好用且免費的程式碼編輯器

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!