Question: I have to build a code for algorithm. What I have to achieve with my algorithm is the following:

I have three numbers, 4,6,8. I have to generate sums with two of those numbers and then all sums with three of those numbers and then with four and so forth. Ofcourse there can be duplicates like in this example: 4+4+6

I got to idea to use "for" loops, so sums with two of those numbers can be generated with two nested for loops. Three nested "for" loops would give sums of three numbers etc...

I can constrain this solution by using "for" for example up until sums of five numbers, but that is not a general solution.

Is there a way or algoritm or mathematical method to do this?

There is a resemblance with math combinatorics.

Answer: 
Try this, `is_numeric` return boolean

```
if (is_numeric($_REQUEST['a']) && $_REQUEST['a'] < 10) {
    $a = 'show some text';
}

```
Here is\_numeric that you have used in if condition will return true or false
so if condition will get either 0 or 1 as result.

So use dual condition within if like below

```
if(is_numeric($_REQUEST['a'] && $_REQUEST['a']<10)
{
      //anything you need to do 
}

```

Thank you