I want increase the student_no, when i click the finish button.
student_no : ABS10000
So i want to split the student_no and increase one. How?
Can i use character_limiter()?
$string1 = "ABS100000";
$string1 = character_limiter($string1, 2);
$string2 = "ABS100000";
$string2 = character_limiter($string2, 3,8);
$string = $string + 1;
echo $string1;
echo $string2;
This is correct…
You’re using that helper function quite wrong. Also, your code makes little sense at some points.
character_limiter()belongs to the Text helper, it’s aim is to provide help in formatting, mostly; look at the companion functions and you will see it.Also, the third (optional) parameter should be a text appended at the end of the trimmed string, something such an ellipsis, for ex. Your second example, which tells to “limit the string to 3 characters and add and 8 at the end” is just plainly wrong, according to your original intentions.
I’m not aware of any helper function (here or in other helpers) that can do what you want, but since you’re coding in php, I don’t know why can’t just do something like (I know there might be better ways to do this):
I’m assuming ‘ABS’ is something fixed and you just want to increment the numerical part of this string.If not, please be more clear in you question and add the relevant informations.