Jump to content
php.lv forumi

vaarda garums..


plastiC

Recommended Posts

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?

Link to comment
Share on other sites

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;
}
?>

Link to comment
Share on other sites

×
×
  • Create New...