The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Echo out how many Ones that is generated via simple PHP script
post Jan 14 2018, 06:40 PM
Post #1

Advanced Member

Group: Members
Posts: 105
Joined: 18-September 12
Member No.: 17,803


I have made a race that finds all numbers that 7 can be divided up to 1000. The task is to find out how many of these numbers exist, that is the number. Thus I put all the values ‚Äč‚Äčinto a common number that was 1.

What I'm wondering is how I can show, with simple php coding, how many 1s are being generated, ie something with count or something

Here is the PHP Code i have writen!


    for ($number=1; $number<=1000; $number++)
    { if ($number % 7 == 0) {
        //print"$number <br>";}
        $antall = $number%$number == 0;
     $enere = array("1");
    echo count ($enere);

Thanks in advanced!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 21st February 2019 - 08:30 AM