Jump to content
php.lv forumi

String Size In Kb ?


andre

Recommended Posts

<?php

$string = 'ADJAKL;JDAjdakl;djAD'; //20 baiti

echo strlen($string)/1024 * 1024; // baitos

?>

Ehehehe shitais ir dienas kods ('code of the day') :D

Vispirms izdalam ar 1024 un tad pareizinam ar 1024

 

Kur logjika :P

A nu Tu nostestē, un ta bļau ! ;)

Link to comment
Share on other sites

A nu Tu nostestē, un ta bļau ! ;)

Nee nu manu nespratni radiija vieta '/1024*1024'

 

Kapeec tad neuzreiz echo strlen($string); // baitos ???

 

Jebshu es varbuut tieshaam neredzu kur ir jeega..

Nu a es akal nesaprotu kapeec jaadala ;)

 

echo strlen($string)/1024

 

tapeec arii pareizinaaju * 1024 :D

tas pac vien buus kas:

 

echo strlen($string) :D

Link to comment
Share on other sites

Nu a es akal nesaprotu kapeec jaadala ;)

Aaa bet izlasiit veelreiz jautaajumu..

Ja nesanaak tad '.. kaa lai es izvadu taa size in kb ??? '

 

Taatad dalam ar 1024..

Ak taa kb nu tad jaa, bet baigi neapaljsh cipars sanaak

nu labi ;)

ja kas ja vajag apalju ciparu tad:

 

strlen($string)/1000;

 

:) ;)

Link to comment
Share on other sites

×
×
  • Create New...