Terminé

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)

and

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

en 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é à:

suraj2

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

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 0 jours
(44 Commentaires)
5.6

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

MimiFL

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

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(150 Commentaires)
6.0
a4logic

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(59 Commentaires)
6.2
maamekal

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(106 Commentaires)
6.6
amutinda

A proposal has not yet been provided

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(63 Commentaires)
5.6
avi2105

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(51 Commentaires)
5.3
Brijrajs76

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(82 Commentaires)
6.0
waqas193

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(14 Commentaires)
5.4
Dckumawat

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(49 Commentaires)
5.5
mahiruho

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(14 Commentaires)
5.0
surender6789

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(20 Commentaires)
4.9
lkhelladi

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,

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(16 Commentaires)
5.0
Beacon09

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(24 Commentaires)
4.7
Maath

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

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(10 Commentaires)
4.5
apachefriends

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(6 Commentaires)
4.3
vbizsolutionss

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 Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(23 Commentaires)
4.6
RandyMarsh

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

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(13 Commentaires)
3.8
GeorgeKazi

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(18 Commentaires)
4.3
mukeshwebdev11

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(9 Commentaires)
4.0
sonukalra

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(12 Commentaires)
3.6
teddytechalp

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

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(4 Commentaires)
3.2