plastiC Posted January 15, 2004 Report Posted January 15, 2004 esmu pa shito lasiijis, bet aizmirsu kur, cereeju varbuut te kaads man varees pateikt, kaa tas iisti daraams.. lieta taada.. man ir gbooks un gribu nofixeet 1 vaarda garumu, lai nefloodotu utt. piem. 1 vaarda maximaalais simbolu skaits 30, kaa to var panaakt?
hu_ha Posted January 15, 2004 Report Posted January 15, 2004 kaut vai ar - if (strlen($teksts)>30) {saki ka ir slikti} else {labi} var arii ar ereg() (skatiities php manuaalii)
blackhalt Posted January 15, 2004 Report Posted January 15, 2004 shite ar pienjemsim ka ir 3: <?php $vards='1234'; function jebkas(){ echo 'te var buut viskas arii die:<br />'; die('mirstu'); } if (strlen($vards) > 3){ $vards = substr($vards,0,3); // vai jebkas(); echo $vards; } ?>
Recommended Posts