Convert this code from ruby to php
arraynumbers = [50,24,5,1,20,30,40,60]
targettotal = 100
# sum up the total of the elements of array
def total(arr)
[login to view URL] { |total, n| total + n }
end
def find_sol(arr, targettotal)
if targettotal > 0
[login to view URL] do |el|
if el == targettotal
return [el]
elsif el < targettotal
sub_arr = arr[([login to view URL](el)+1)..-1]
ans = find_sol(sub_arr, targettotal - el)
if [login to view URL] > 0
return [el] + ans
end
end
end
end
[]
end
# sort numbers descending
answer = find_sol([login to view URL] { |x,y| y <=> x }, targettotal)
puts answer.to_s
puts "Total: " + total(answer).to_s
Hello sir,
I have 6+ year experience in website development and customization.
Also i expert in jquery and javascript.
Please check my past work
[login to view URL]
[login to view URL]
[login to view URL]
I able to make this work with good quality.
Thanks
Hello Sir,
I'm 5 years experience in PHP and I'm interested in this job. I'm available to do this task right now.
Looking forward to hear from You.
Thanks,