PHP function to Calculate Remainder

Hello I need a function in php which will calculate the remainder for me. For example:

I have an array like the one below and it contain values, each value represent the number of items fitting in a particular package size. (in this case a package which can contain 10, another of 8 and another of 5 object)

$arrContainerSizes = array(10, 8, 5)

Now I need a function (YOUR TASKS IS TO MAKE THIS) which can be given the above array as a parameter and the total number of items i have (integer) and it will return how many of each package size i need.

For example, if i give this function this parameter:

$arrContainerSizes = array(10, 8, 5)


49 (total number of items)

it must return:

4 packages of 10

1 package of 8

and 1 item is left without package

another example, if i give it: $arrContainerSizes = array(10, 8, 5) and 47

it must return:

4 packages of 10 (because 47divided by 10 = 4.7 - therefore 4 and we leave the fraction for the next package)

1 container of 5 (because we had 7 remaining fraction from before - 5 of which can fit in a package of 5)

and 2 item without container.

it might sounds like complicated and i would happy explain further

happy bidding

Compétences : PHP

Voir plus : php make function create recordset, time comparison function php, delete records function php, using case else function php, input function php, search function php, datediff function php, bidding function php, integral function php, image sepia function php samples, keyword extract function php, dateadd function php, search function php drupal, vb6 mid function php, view check box mail function php, search function php form

Concernant l'employeur :
( 239 commentaires ) marsalforn, zebbug, Malta

N° du projet : #12681746

Décerné à :


WORKING DEMO: [url removed, login to view] I have done it. I have done it. I have done it. Thanks, Suraj

30 $ USD en 0 jours
(44 Commentaires)

25 freelance font une offre moyenne de $27 pour ce travail


Hi, i m serious freelancer with 100% completion rate and i believe i can help you. I've done hundreds of PHP projects and i've never had a single problem. If you are interested please send me a message so i can ask one Plus

15 $ USD en 0 jours
(150 Commentaires)

Dear Sir/Madam, Thank you for this wonderful opportunity. I am keenly considering your job post including these skills.I am working as team leader in A4Logic it is software and web solution company we are operati Plus

30 $ USD en 1 jour
(59 Commentaires)

Hi Greeting of the day!! ☞ WHY ME :- I have more than 5 years of experience in Web Development/Designing & have Developed number of websites in the past. I have an expertise in : ✔ PHP and it's Fram Plus

55 $ USD en 1 jour
(106 Commentaires)

A proposal has not yet been provided

25 $ USD en 1 jour
(63 Commentaires)

Hi, Hope you doing good? I am experienced PHP developer having expertise in e-commerce domain using Zen Cart, Wordpress, Codeigniter, OsCommerce, CreLoaded, MVC framework, Prestashop, Opencart, HTML5, Bootstrap, Plus

30 $ USD en 1 jour
(51 Commentaires)

Hello, I am very interested in the project and I would like to apply to it. I'm a web developer with 7 years experience in PHP, MySQL, CSS3, HTML5 and deep knowledge WordPress, WP plugins, development issues and Plus

25 $ USD en 1 jour
(82 Commentaires)

I am muhammad waqas,I have more than 8 years of experience in php development,frameworks like laravel, Codeiginiter,YII and CMS like wordpress,Drupal.I am new on freelancer 15 projects 5 stars rating but I am the top r Plus

35 $ USD en 1 jour
(14 Commentaires)

Dear Client, We are expertise in php, core php, CMS, HTML5, CSS3, bootstrap, WordPress, PSD to HTML, Angular JS, Node JS photoshop, OPencart, Codeignitor, Laravel and many other technologies. Please have a look a Plus

50 $ USD en 1 jour
(49 Commentaires)

Hi, Greetings from Mahiruho Consulting Services (MCS) India, Kolkata We have web development team(with 15+years of experience) and want to work hard and smart.. We are passionate about our work and do it with full Plus

20 $ USD en 1 jour
(14 Commentaires)

SENIOR WORDPRESS DEVELOPER WITH 6+ YEARS EXPERIENCE Thank you for such a great opportunity. I am very glad to see your Job Posting according to my skill set. I have read your requirements and I’m pretty confiden Plus

30 $ USD en 1 jour
(20 Commentaires)

Hello, I'd be glad to implement the PHP remainder function for you. looking forward to chat with you soon for more details. Best regards,

30 $ USD en 0 jours
(16 Commentaires)

Hi Understood. I am available to create this function right now. Looking forward to seeing your reply. Thanks. Regards Ahsan

19 $ USD en 1 jour
(24 Commentaires)

Hi Sir , Update : Hi , I get it I can do exactly what you need in less than 15 minutes . after I done it and you test it then you pay sound good deal ? I am a good programmer you can see my profile :) I can prov Plus

10 $ USD en 0 jours
(10 Commentaires)

Hi, We have reviewed the project completely and have a fair understanding of the project scope. Kindly come forward to discuss more about the project in detail and turn it into reality with your idea and our skil Plus

30 $ USD en 1 jour
(6 Commentaires)

Hello, As per your requirement we have an excellent team to do your project with respect to your [url removed, login to view] are working in this platform since last 10 years. Below mentioned is the link for our portfolio: h Plus

30 $ USD en 1 jour
(23 Commentaires)

Hello, I am an experienced and talented UK based Web Developer looking to be hired. I am ready to start working for you now. I've already gone over the project and can deliver it within 10mins. Question: Do you w Plus

30 $ USD en 0 jours
(13 Commentaires)

Hello! I completely undertsnad what you require and can begin work on this right now. Let's talk! Thanks

35 $ USD en 1 jour
(18 Commentaires)

I assure you for better quality work in least amount of timing . I am a Professional HTML5, CSS3, jquery, PHP, joomla and Responsive WordPress theme developer and working as a HTML5, CSS3, jquery, PHP, joomla and Wo Plus

17 $ USD en 1 jour
(9 Commentaires)

Dear Hiring Manager, NEW YEAR WISHES! PROJECT REQUIREMENTS : -> Need to develop the function in PHP for calculator logic -> Good to discuss complete requirements before START Please check we have worked on o Plus

30 $ USD en 1 jour
(12 Commentaires)

Hello, We recently we complte a "325$" project. you can check this in our profile. We are happy to assist you in this case, we are professional IT company from India having clients across the globe. We are indust Plus

25 $ USD en 1 jour
(4 Commentaires)