<p>Fixed this now, All you have to do is change it to this</p>

<pre><code>floatval(trim()) ie ...    $betamount=floatval(trim($_POST['bet'])); 
</code></pre>

<p>for numbers</p>

<p>and this</p>

<pre><code>and just trim()  ie ... $litecoinaddr=trim($_POST['address']); 
</code></pre>

<p>for strings</p>

CC BY-SA 3.0
2013-09-25T20:04:24.107Z
2013-09-25T20:04:24.107Z
Sam Vella
<p>Admin isnt a variable so its a string.</p>

<p>Strings should be in quotes so it should be.</p>

<pre><code>$litecoin-&gt;move($myusername,'Admin',$betamount);
</code></pre>

<p><a href="http://php.net/manual/en/language.types.string.php" rel="nofollow">http://php.net/manual/en/language.types.string.php</a></p>

CC BY-SA 3.0
2016-09-07T14:17:44.387Z
2016-09-07T14:17:44.387Z
Web Weave
<p>I am trying to run the following code <br></p>

<pre><code>$betamount=$_POST['bet']; 
$litecoin-&gt;move($myusername,Admin,$betamount);
</code></pre>

<p>but it will not work. it does however work when i replace $betamount with an actual number ie</p>

<pre><code>$litecoin-&gt;move($myusername,Admin,0.2);
</code></pre>

<p>or </p>

<pre><code>$betamount=0.1; 
$litecoin-&gt;move($myusername,Admin,$betamount);
</code></pre>

<p>any ideas on whats going wrong ? the $_POST['bet'] is defiantly a number because i have tried multiplying in php and it all works fine.</p>

<json-rpc><php>
jsonRPCClient Error with php variables
Sam Vella
# jsonRPCClient Error with php variables

(Asked by: username_0 on 2013-09-25)

I am trying to run the following code

```
$betamount=$_POST['bet']; 
$litecoin->move($myusername,Admin,$betamount);

```

but it will not work. it does however work when i replace $betamount with an actual number ie

```
$litecoin->move($myusername,Admin,0.2);

```

or

```
$betamount=0.1; 
$litecoin->move($myusername,Admin,$betamount);

```

any ideas on whats going wrong ? the $\_POST['bet'] is defiantly a number because i have tried multiplying in php and it all works fine.

**Tags:** json-rpc, php


---

## 2 answers

### Answer by username_0 on 2013-09-25. Score: 0

Fixed this now, All you have to do is change it to this

```
floatval(trim()) ie ...    $betamount=floatval(trim($_POST['bet'])); 

```

for numbers

and this

```
and just trim()  ie ... $litecoinaddr=trim($_POST['address']); 

```

for strings


---

### Answer by username_1 on 2016-09-07. Score: 0

Admin isnt a variable so its a string.

Strings should be in quotes so it should be.

```
$litecoin->move($myusername,'Admin',$betamount);

```

<http://php.net/manual/en/language.types.string.php>


---

