Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,838 members, 7,820,919 topics. Date: Wednesday, 08 May 2024 at 03:05 AM

Another Php Algorithm Help Needed - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Another Php Algorithm Help Needed (780 Views)

Simple Algorithm Exercise / My C++ Voting System Program Algorithm / Pls Programmers Help With Similarities Of Pseudocode & Algorithm (2) (3) (4)

(1) (Reply) (Go Down)

Another Php Algorithm Help Needed by Irelokeh(m): 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(m): 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)

Electronic Pills Will Be Hard To Swallow Without Absorbable Batteries / Webs And Apps Development / Do You Want To Open Your Blog On Blogger Platform

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.