How to pick a complex string from MySQL

We can pick a string from MySQL database with various style.
Example, the value from database is NCABZ-2007
And we want only view ABZ
Here is the CODE.

$data = "NCABZ-2007";
$new_data = substr($data, 2 , 3);

2 = number of data from the left (N=0, C=1, A=2, B=3, etc.)
3 = how much char we want to display

No comments: