Vo1The Posted February 16, 2011 Report Share Posted February 16, 2011 (edited) Tātad man velviens jautājums kā lai iedbū te echo iekšā tā lai viņš uz manim nelamājās if($row[2] == "4") {$gp = ROOT; } Gribu lai kad nodefinē GP var ielikt font krāsas ! Katrai grupai savu Respektīvi kaut kā šādi bet viņš lamājās ! if($row[2] == "4") {$gp = echo '<font color="blue">ROOT<font>'; } atkārtošu velreiz php tikai mācos !Tādēļ neko nepārmetiet ja jums tas liekas vienkārši. Sintaksi vel īsti tā neizprotu tās pēdiņas un kā tur tā nja ! Edited February 16, 2011 by Vo1The Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 16, 2011 Report Share Posted February 16, 2011 Neko nesapratu. Pastāsti! Quote Link to comment Share on other sites More sharing options...
ohmygod Posted February 16, 2011 Report Share Posted February 16, 2011 (edited) Ar rakstīšanas metodi varētu pietikt ((: if($row[2] == "4") {$gp = '<font color="blue">ROOT<font>'; echo $gp; } vai vienkārši echo '<font color="blue">ROOT<font>'; ja nedomā viņu vairāk nekur izmantot Edited February 16, 2011 by ohmygod Quote Link to comment Share on other sites More sharing options...
Roberts.R Posted February 16, 2011 Report Share Posted February 16, 2011 Viens ir tas, kas Tev ir definēts iekš ROOT? Ja nesaprati jautājumu, pārskati, vai Tev ir izmantots, un vai vispār ir vajadzīgs http://php.net/manual/en/function.define.php Ja gribi katram $row[$x] definēt savu krāsu, tad ieteiktu šādi: switch $row[$x] { default: case $x = 1: echo "<p style=\"color: red\">teksts</p>"; break; case $x = 2: echo "<p style=\"color: green\">teksts</p>"; break; case $x = 3: echo "<p style=\"color: blue\">teksts</p>"; break; } Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 16, 2011 Report Share Posted February 16, 2011 Robert, kas tā par jocīgu "Switch" pieraksti? Quote Link to comment Share on other sites More sharing options...
Vo1The Posted February 16, 2011 Author Report Share Posted February 16, 2011 Ar rakstīšanas metodi varētu pietikt ((: if($row[2] == "4") {$gp = '<font color="blue">ROOT<font>'; echo $gp; } vai vienkārši echo '<font color="blue">ROOT<font>'; ja nedomā viņu vairāk nekur izmantot Paldies pirmais variants nostrādāja par to nemaz neidomājos no sākuma vienīgi beigās echo $gp; Bija jānoņem citādi sanāk 2 reiz ! Paldies Quote Link to comment Share on other sites More sharing options...
Roberts.R Posted February 16, 2011 Report Share Posted February 16, 2011 Robert, kas tā par jocīgu "Switch" pieraksti? Liekas, ka hokeja un alus ietekme... :( Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 17, 2011 Report Share Posted February 17, 2011 (edited) Respektīvi kaut kā šādi bet viņš lamājās ! if($row[2] == "4") {$gp = echo '<font color="blue">ROOT<font>'; } Padomaa logiksi !! $gp ir vienads ar IZVADIT uz ekrana xxx tekstu !! '=' noziimee Pieskjirsanas OPERATORS 'echo' izvadisanas operators 2 operatori pec kartas Nedrikst buut !!! sakuma pieskjir miniigajm vertibu un talak jau vari darboties izvadiit/apstradaat etc. Edited February 18, 2011 by Grey_Wolf Quote Link to comment Share on other sites More sharing options...
mickys Posted February 18, 2011 Report Share Posted February 18, 2011 http://php.net/manual/en/function.echo.php Return Values No value is returned. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.