# Randomly Generated Numeric Symbol

**URL:** <https://forum.kirupa.com/t/randomly-generated-numeric-symbol/198473>\
**Category:** programming\
**Created:** [August 25, 2006, 10:42am UTC](https://forum.kirupa.com/t/randomly-generated-numeric-symbol/198473 "2006-08-25T10:42:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesleuth](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@thesleuth](https://forum.kirupa.com/u/thesleuth)\
**Post date:** [August 25, 2006, 10:42am UTC](https://forum.kirupa.com/t/randomly-generated-numeric-symbol/198473/1 "2006-08-25T10:42:52Z")

</div>

I used the following code to generate +, - and \*

```php
function symbol() {
    $values = "+-*";
    $string = $values{rand(0, 2)};
    return($string);
}

```

And I have two numbers 3 and 4

I want to used the randomly generated symbol to either add, minus or time 3 and 4. How do I do that using PHP? Thanks in advance
