Help Manipulating String...
Posted: Sat Nov 26, 2005 10:30 am
I have problem manipulating a string...
Question is how do i make print out to SLM-03??? bcuz intval() made my 03 to 3, any idea how to do it right???
Thnx...
Code: Select all
$str = "SLM-03";
$idTemp = str_replace("SLM-","",$str); // Replace the 'SLM-' with '' and got $idTemp = '03'
intval('$idTemp'); // Change the '03' to integer
$salesID = $idTemp + 1; // Adding the '03' with 1
echo "SLM-$salesID"; // it give me SLM-3 not SLM-03Thnx...