: This article describes how to obtain the value after a special character (from stackoverflow) in a variable-length string in MySQL. For more information about PHP tutorials, see. This is a question from stackoverflow (link
Http://stackoverflow.com/questions/35122231/mysql-how-to-get-numeric-value-after-special-character-in-varchar)
I have a record. how can I obtain the rightmost value (, 10) after the slash "/" in this record? if you have PHP code, you can automatically reset the month value, that's great.
Answer:
If you know that all records are in the form of A/x/y, and then "/" is always used as A special symbol, you can use explode ()
Code:
substring_index(): select substring_index(col,'/',-1)
from t;
If you wantt
Change to number
select substring_index(col,'/',-1)+1
from t;
The second answer:
Try this:
$str = "ABC/209116/1";
$replace_with = "0";
$str= substr(0,strrchr($str,"/"));
$replace_with;
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The preceding section describes how to obtain the value after a special character (from stackoverflow) in a variable-length string in MySQL. It includes some content and is helpful to anyone interested in the PHP Tutorial.