DrTrans Posted August 18, 2009 Share Posted August 18, 2009 my variable : $variable = "27-5274594" How do i pull the last 4 digits of the $variable without setting $variable = "4594"; in example: $variable = $row['TaxID']; << Where variable would be transformed to only the last 4 digits >> print "$variable"; Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted August 18, 2009 Share Posted August 18, 2009 substr $variable=substr($row['TaxID'],-4); to get the first part $variable=substr($row['TaxID'],0,-4); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.