Sephy Posted April 18, 2008 Report Posted April 18, 2008 ir kada komanda ar ko var kadu skaitlu virkni parveidot binari(piemeram 3432432432 uz 00110001(piemers nepareizs ;D)). ja nav tad iedodiet kadu skipteli kas parveido binari ;P
Aleksejs Posted April 18, 2008 Report Posted April 18, 2008 http://lv.php.net/manual/en/function.decbin.php
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 man te error ;[ reku mana funkcija: <?php $ciparz = "13337"; //cipars ko vajag parveidot echo "cipar test $ciparz"; //////////////parveidojam pa binari//////////////////////// function needbinary($binarais){ $binari=decbin($ciparz); } echo "binarajaa kodaa tavs cipars bus $binarais"; //izvada binaro ciparu ;D ?>
Aleksejs Posted April 18, 2008 Report Posted April 18, 2008 (edited) Un KĀDS tas error ir?! :@ Tu jau to funkciju nevienā vietā neizsauc! Edited April 18, 2008 by Aleksejs
andrisp Posted April 18, 2008 Report Posted April 18, 2008 Protams, tu jau to funkciju nemaz neizsauc. un prichom tev vispaar veidot to needbinary ?
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 Protams, tu jau to funkciju nemaz neizsauc. un prichom tev vispaar veidot to needbinary ? a ja nu man bus vairak nekaa viens cipars(kadi 10 piemeram) es gribetu lai ar manu funkciju vinus var aprevidot nevis katru reizi raxtot decbin ;P
andrisp Posted April 18, 2008 Report Posted April 18, 2008 nu bet tā tava mega funkcija tāpat ņem pretī tikai vienu ciparu. :) bet nu labi tas nav svarīgi. problēma jau ir citur.
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 ai nu labi iztikshu bez funkcijas ;D. raxtishu katram ciparam atsevishki parveidi ;P
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 nakamais jautajums: es parveidoju kautkadu tur ciparu 133337 un iznak 10000100101010001. man vajag izgriezt takaa 1,2,4,8,16 utt(nu tipa 2npakapee) un noglabat teksts failaa kaa to varetu dabut gatavu ;P?!
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 man vajag izgriezt no 101010000110001 skaitlus kas ir 2n pakapee. tatad man vajag izgriezt 1 skaitli(kas ir 20=1), 2 skaitlis(kas ir 21=2) un kaa arii 4,8,16,32,64 utt. shajaa gadijumaa izgrieztaa virkne bus 0001!! nu text failee es vinu maceshu saglabat ;D
Sephy Posted April 18, 2008 Author Report Posted April 18, 2008 (edited) hmm nezinu laikam jau nee ;D. hmm un man vispaar nevajag parveidot visu 1337 uz 01001000101 bet gan sitaa 1=0 3=1 3=1 7=0 un galaa dabut shajaa gadijumaa 0110 ;P Edited April 18, 2008 by Sephy
bubu Posted April 18, 2008 Report Posted April 18, 2008 bet gan sitaa 1=0 3=1 3=1 7=0 un galaa dabut shajaa gadijumaa 0110 ;P wtf?
Recommended Posts