php add dots to a variable received from load function -


i receive variable through jquery

var x = 15; $("#block").load("file.php", {n:x}); 

when try use

$i=$_post['n'];   echo $i;  

i receive : .15.

my question - how delete dots. , why appear.

to delete dots:

<?php $i = trim($_post['n']);  // delete first dot (if exists) if(substr($i, 0, 1) == '.') $i = substr($i, 1); // delete last dot (if exists) if(substr($i, -1) == '.') $i = substr($i, 0, -1);  echo $i; ?> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -