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"; Link to comment https://forums.phpfreaks.com/topic/170766-solved-split-variable-for-only-the-last-4-digits/ 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); Link to comment https://forums.phpfreaks.com/topic/170766-solved-split-variable-for-only-the-last-4-digits/#findComment-900602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.