What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Help

PHP Help
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. PHP Help
Does anyone know what's wrong with this?

code:
class bin2dec{

    function main($invoer){
        if(isset($invoer) && $invoer != ""){
            $this->substr($invoer);
        }else{
            die("ERROR 0x001");
        }
    }
    function substr($invoer){
        for($i=0; $i<strlen($invoer); $i++){
            $uitvoer[] = substr($invoer,$i,1);
        }
        $this->calculate($uitvoer);
    }
    function calculate($invoer){
        $pw=count($invoer) - 1;
        for($i=0; $i<count($invoer); $i++){
            $uitvoer[] = $invoer[$i] * pow(2, $pw);
            $pw--;
        }
        $this->addall($uitvoer);
    }
    function addall($invoer){
        $uitvoer=0;
        for($i=0; $i<count($invoer); $i++){
            $uitvoer = $invoer[$i] + $uitvoer;
        }
        $this->returnit($uitvoer);
    }
    function returnit($invoer){
        return $invoer;
        //die("Success ofzow");
    }
}

That return on the end doesn't work :(

If I use that die it dies normally...

MyBB wrecks the indents :(

This post was edited on 01-20-2006 at 05:12 PM by Ezra.
[Image: 1-0.png]
             
01-20-2006 05:11 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Help - by Ezra on 01-20-2006 at 05:11 PM
RE: PHP Help - by Plik on 01-20-2006 at 05:24 PM
RE: PHP Help - by Ezra on 01-20-2006 at 05:30 PM
RE: PHP Help - by Plik on 01-20-2006 at 05:36 PM
RE: PHP Help - by Ezra on 01-20-2006 at 05:41 PM
RE: PHP Help - by segosa on 01-20-2006 at 08:53 PM
RE: PHP Help - by J-Thread on 01-20-2006 at 10:23 PM
RE: PHP Help - by Ezra on 01-20-2006 at 10:31 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On