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

Keahlian: PHP

Lihat lebih lanjut: 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

Tentang Pemberi kerja:
( 239 ulasan ) marsalforn, zebbug, Malta

ID Proyek: #12681746

Diberikan kepada:


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

$30 USD dalam 0 hari
(44 Ulasan)

25 freelancer menawar dengan rata-rata $27 untuk pekerjaan ini


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 Lebih banyak

$15 USD dalam 0 hari
(150 Ulasan)

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 Lebih banyak

$30 USD dalam 1 hari
(59 Ulasan)

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 Lebih banyak

$55 USD dalam 1 hari
(106 Ulasan)

A proposal has not yet been provided

$25 USD dalam 1 hari
(63 Ulasan)

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, Lebih banyak

$30 USD dalam 1 hari
(51 Ulasan)

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 Lebih banyak

$25 USD dalam 1 hari
(82 Ulasan)

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 Lebih banyak

$35 USD dalam 1 hari
(14 Ulasan)

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 Lebih banyak

$50 USD dalam 1 hari
(49 Ulasan)

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 Lebih banyak

$20 USD dalam 1 hari
(14 Ulasan)

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 Lebih banyak

$30 USD dalam 1 hari
(20 Ulasan)

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 dalam 0 hari
(16 Ulasan)

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

$19 USD dalam 1 hari
(24 Ulasan)

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 Lebih banyak

$10 USD dalam 0 hari
(10 Ulasan)

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 Lebih banyak

$30 USD dalam 1 hari
(6 Ulasan)

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

$30 USD dalam 1 hari
(23 Ulasan)

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 Lebih banyak

$30 USD dalam 0 hari
(13 Ulasan)

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

$35 USD dalam 1 hari
(18 Ulasan)

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 Lebih banyak

$17 USD dalam 1 hari
(9 Ulasan)

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 Lebih banyak

$30 USD dalam 1 hari
(12 Ulasan)

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 Lebih banyak

$25 USD dalam 1 hari
(4 Ulasan)