PHP Help - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: PHP Help (/showthread.php?tid=55104) PHP Help by Ezra on 01-20-2006 at 05:11 PM
Does anyone know what's wrong with this? code: That return on the end doesn't work If I use that die it dies normally... MyBB wrecks the indents RE: PHP Help by Plik on 01-20-2006 at 05:24 PM
its because of this: code: Basically return, returns the value as the result of the function where there must be some way of outputing or storing the value otherwise it will be forgoten. RE: PHP Help by Ezra on 01-20-2006 at 05:30 PM So, how do I return the last value to where I called main in my php script? RE: PHP Help by Plik on 01-20-2006 at 05:36 PM
I guess you could return the result up through the functions, like this: code: But it would make more sense to just have all the code in the one main function. RE: PHP Help by Ezra on 01-20-2006 at 05:41 PM
quote: I splitted it this way, cause now every function has a different thing to do, one splits the string, the other calculates the decimal representation, and the other one adds everything together. Later I will add code to convert to other systems like hexadecimal and back And thanks for your help RE: PHP Help by segosa on 01-20-2006 at 08:53 PM PHP has a built in substr() function so why do you have your own? RE: PHP Help by J-Thread on 01-20-2006 at 10:23 PM
quote: Why not: code: Try to learn as much php functions as possible, most of the things you want are already build in... RE: PHP Help by Ezra on 01-20-2006 at 10:31 PM
quote: I used php's substr function, but I wanted to put all the characters in the array, so I used a loop to loop trough all the characters quote: I know php can already convert but I had to make a convertor for school. Actually it was a project for VB.NET , but because I'm better with php I tried it with that, and after that I tried to make it OOP I added decimal 2 binary btw, but now my ajax script doesn't work anymore |