Splitting of string in not happening. m trying with str_split() function
I am stuck with a small problem in PHP with string function. I m fetching last row value from the emp_id column. This gives me 1mw112 and this is a correct result. What I want actually to increment it automatically which is not possible because of this 
emp_id is mixed of characters and numbers. What I can try to do now is to split this 
value into two parts ( 1mw and 112 ). If this is possible then I can store 112 in another variable and can easily increment by 1 manually and while inserting in to the table; I can display it in readonly format in a form. I've tried str_split($var,3), but is not working.
      
This is what m trying with :
    
    		<?php
    		$db=mysql_connect("localhost","m","m");// database connection

    		mysql_select_db("mars",$db); // database selection
    		
    		//$query1="SELECT LAST(eid) AS eid FROM emp_info" ;
    		
    		$query1="SELECT eid FROM emp_info ORDER BY eid DESC LIMIT 1"; // saql query 

to //select last value from the column
    		
    		$result=mysql_query($query1);

    		while($record=mysql_fetch_assoc($result))

    		{

    		while(each($record))

    		{

    		   $eid=$record['eid'];

    		}

    		}

    		echo $eid;
    		
    		echo "<br>";
    		
    		$splitted=str_split($eid,-2);
    		
    		echo $splitted;
    		
    		?>
     
    
     This is echoing "array" as an output
      Can anyone please help me out to store last 3 digits in an another variable? Thanks in advance...
Splitting of string in not happening. m trying with str_split() function
===

I am stuck with a small problem in PHP with string function. I m fetching last row value from the emp_id column. This gives me 1mw112 and this is a correct result. What I want actually to increment it automatically which is not possible because of this 
emp_id is mixed of characters and numbers. What I can try to do now is to split this 
value into two parts ( 1mw and 112 ). If this is possible then I can store 112 in another variable and can easily increment by 1 manually and while inserting in to the table; I can display it in readonly format in a form. I've tried str_split($var,3), but is not working.
      
This is what m trying with :
    
    		<?php
    		$db=mysql_connect("localhost","m","m");// database connection

    		mysql_select_db("mars",$db); // database selection
    		
    		//$query1="SELECT LAST(eid) AS eid FROM emp_info" ;
    		
    		$query1="SELECT eid FROM emp_info ORDER BY eid DESC LIMIT 1"; // saql query 

to //select last value from the column
    		
    		$result=mysql_query($query1);

    		while($record=mysql_fetch_assoc($result))

    		{

    		while(each($record))

    		{

    		   $eid=$record['eid'];

    		}

    		}

    		echo $eid;
    		
    		echo "<br>";
    		
    		$splitted=str_split($eid,-2);
    		
    		echo $splitted;
    		
    		?>
     
    
     This is echoing "array" as an output
      Can anyone please help me out to store last 3 digits in an another variable? Thanks in advance...