₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,301 members, 8,421,229 topics. Date: Saturday, 06 June 2026 at 03:38 AM

Toggle theme

Another Php Algorithm Help Needed - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingAnother Php Algorithm Help Needed (844 Views)

1 Reply (Go Down)

Another Php Algorithm Help Needed by Irelokeh(op): 7:53pm On Aug 17, 2015
Hi friends and devs,following the nice feedback I got from a previous question concerning my php program I'm glad to know there are great devs here ok

I want this code to echo the product of every digit in 1234480 resulting in a 24688160
instead of 2468960 which is 24688160x2

$numb = 1234480;
$sumb = 0;
do {
$sumb += $numb*2;
}
while ( $numb =
(int) $numb *2);
echo "Sea" .$sumb;


I'd like to finish the software soon
Re: Another Php Algorithm Help Needed by Irelokeh(op): 8:06pm On Aug 17, 2015
THANKS GUYS DE PROBLEM HAS BEEN SOLVED!!
Re: Another Php Algorithm Help Needed by Nobody: 9:09pm On Aug 17, 2015
How you come manager take solve am?
- dhtml18
Re: Another Php Algorithm Help Needed by fattbabakay(m): 10:38pm On Aug 17, 2015
I understand NOT
Re: Another Php Algorithm Help Needed by Kensharval(m): 8:56pm On Aug 18, 2015
If you wish to have a professional shared hosting quality in a free hosting package, come and host with 000webhost.com and experience the best service you can get absolutely free. Founded in December 2006, 000webhost.com has a trusted free hosting members base of over 60,000 members and still counting! Offering professional quality hosting, support, uptime and reliability, we have a great community of webmasters, you'd love to be a part of! Register now and get it all free: *** 1500 MB of disk space *** 100 GB of data transfer *** PHP and MySQL support with no restrictions *** cPanel control panel *** Website Builder *** Absolutely no advertising! Join us now: http:// www.000webhost.com/876430.html
Re: Another Php Algorithm Help Needed by danvery2k6(m): 6:38pm On Aug 19, 2015
Irelokeh:
THANKS GUYS DE PROBLEM HAS BEEN SOLVED!!
It'll be nice if you share your solution here so that people with similar problems could get help without 'thread proliferation'

Thanks
Re: Another Php Algorithm Help Needed by jacob05(m): 7:13pm On Aug 19, 2015


<?php
function timesTwo($n)
{
return($n * 2);
}

echo implode(array_map("timesTwo", str_split("1234480" )));
//OR (going crazy)
echo implode(array_map(function($n){ return($n * 2);}, str_split("1234480" ))) ;


Re: Another Php Algorithm Help Needed by Nobody: 7:22pm On Aug 19, 2015
Na wa o
Re: Another Php Algorithm Help Needed by jacob05(m): 7:26pm On Aug 19, 2015
MuhammaduBuhari:
Na wa o
LOLz.... hmmm
1 Reply

Simple Algorithm ExerciseMy C++ Voting System Program AlgorithmPls Programmers Help With Similarities Of Pseudocode & Algorithm234

If You Need SMS Or Automated Voice Applications - Reach Me On This TreadUse Your Blog To Make Money, Get 36 Tried-and-true Ways To Promote Your BlogProgrammers Please Help Me....i Need A Good Wordpress Host..