freak Posted December 10, 2004 Report Share Posted December 10, 2004 Kā var izdarīt sekojošu lietu: Dots: $a=2; $b=3;$ab=4; Man vajag, lai saliekot divus mainīgos print $a.$b; izvada nevis: 23 ,bet gan $ab vērtibu, t.s ir 4. Cik atceros bij manliekas speciāla funkcija. Tikai piemirsu kāda.... Link to comment Share on other sites More sharing options...
Analgiins Posted December 10, 2004 Report Share Posted December 10, 2004 echo $ab; // rezultaats: 4 Bet vispaar shitaadu jautaajumu veel neesmu lasiijis - vai nu tu esi kaut kaads gjeenijs vai pilniigs aamuurs. Tev ir triis mainiigie, izvadi kuru tev vajag. Kaut kaads nelogjisks jautaajums P.S. Parasti uz shitik lameriskiem jautaajumiem pat neskatos virsuu, bet nu shitas paarspeej visus! Link to comment Share on other sites More sharing options...
freak Posted December 10, 2004 Author Report Share Posted December 10, 2004 Tu nepareizi saprati :))) MAn vajag tā, lai pa simboliem saliekot kopa iegust mainigo, kuru izvadot iegust sho rezultatu. $x=$a.$b print $x Iegūst 4. Link to comment Share on other sites More sharing options...
Analgiins Posted December 10, 2004 Report Share Posted December 10, 2004 skaidrs. Funkcija eval, ja tu to domaa Sorry, pa uzbraucieniem, nu esmu es taads rupjsh Link to comment Share on other sites More sharing options...
freak Posted December 10, 2004 Author Report Share Posted December 10, 2004 Skaidrāk būs tā. Ir dots $x="$ab" Ka, lai izvada mainīgo, kura nosaukumu satur $x Link to comment Share on other sites More sharing options...
freak Posted December 10, 2004 Author Report Share Posted December 10, 2004 Jā to arī vajadzēja. Link to comment Share on other sites More sharing options...
Analgiins Posted December 10, 2004 Report Share Posted December 10, 2004 nu ja tu raxti shitaa, tad arii izvadiis 4: <?php $a=2; $b=3; $ab=4; $x="$ab"; echo $x; // izvadiis 4 ?> ja tu sakjeedee divus mainiigos: $x=$a.$b, tad vienalga izvadiis katru mainiigo atseviskhi, plus veel punkts pa vidu buus, jo katram mainiigajam tach priekshaa ir $ simbols, tad vinjsh kaut kaa ir jaatfiltree... Link to comment Share on other sites More sharing options...
freak Posted December 10, 2004 Author Report Share Posted December 10, 2004 Te ir tas, ko man vajadzēja: $lv_sadala2=99; $foto="lv_sadala2"; $go="\$rezult=\$".$foto.";"; eval("$go"); print " $go <br> $rezult"; Link to comment Share on other sites More sharing options...
Analgiins Posted December 10, 2004 Report Share Posted December 10, 2004 es tik nesaprotu, kaapeec tev taadas paarveertiibas vajadziigas, nevar uzreiz panjemt $lv_sadala2 kaa $rezult ? Link to comment Share on other sites More sharing options...
Recommended Posts