freak Posted February 6, 2008 Report Share Posted February 6, 2008 (edited) Vai var ar PHP panakt sekojoshu lietu neizmantojot masivus: $x="a"; $b=1; $a1="999"; print $x$b; // <- taa lai izvadaas 999 tas ir $a1 vertiba Edited February 6, 2008 by freak Link to comment Share on other sites More sharing options...
andrisp Posted February 6, 2008 Report Share Posted February 6, 2008 <?php $x="a"; $b=1; $a1="999"; print ${$x.$b}; ?> Link to comment Share on other sites More sharing options...
Sasa Posted February 6, 2008 Report Share Posted February 6, 2008 un kāds izskatīsies rezultāts? Link to comment Share on other sites More sharing options...
andrisp Posted February 6, 2008 Report Share Posted February 6, 2008 999 Link to comment Share on other sites More sharing options...
andrisp Posted February 6, 2008 Report Share Posted February 6, 2008 Vēl viens perverss variants: <?php $x="a"; $b=1; $a1="999"; $z = $x.$b; print $$z; ?> Link to comment Share on other sites More sharing options...
Sasa Posted February 6, 2008 Report Share Posted February 6, 2008 kas tas: '$x.$b;' un kapē nevar kaut kā vienkāršāk izvadīt $a1 kas savu kārti ir 999?? piemēram echo($a1) kaut kā varbūt nepareiza sintakse bet kapē tādā veidā neizvada ko dos tā savādā izvadīšana? Link to comment Share on other sites More sharing options...
bubu Posted February 6, 2008 Report Share Posted February 6, 2008 Sasa, un ja tev ir, piemēram šāds kods: $x="a"; $b=$_GET['id']; $a1="999"; Kā tad tu uzrakstīsi $a1 ? Link to comment Share on other sites More sharing options...
Sasa Posted February 6, 2008 Report Share Posted February 6, 2008 vispār laikam šito nesaprotu izvadīšu tāpat kā jau iepriekš rakstīju jo $x ; $b un $a1 ir pēc manām domām neatkarīgi mainīgie! Link to comment Share on other sites More sharing options...
Aleksejs Posted February 6, 2008 Report Share Posted February 6, 2008 Nu tad pārlasi vēlreiz ;) Link to comment Share on other sites More sharing options...
Recommended Posts