Php string truncation problem! Paste yybb_cx online.
Yybb_xdf.
Just like the above string. I only need the letters behind _ and before.
For example, what I need are cx and xdf?
Reply to discussion (solution)
$ S = <
Does this replace the original one?
$ S = <
Eldest brother, I have never engaged in php.
In fact, what I want is very simple, that is
$ Datas = $ _ POST ["shujuku"]; // I have a sent string assigned to $ datas, which is like yybb_xdf.
Now I want to extract the $ datas string between _ and. according to my requirements and assign it to a new variable.
Preg_match ('/_ (. + ?) \./S', $ data, $ m); $ a = $ m [1]; // $ a is the variable you want
Preg_match ('/_ (. + ?) \./S', $ data, $ m); $ a = $ m [1]; // $ a is the variable you want
Eldest brother .. There is only one vertex...
I took the letters before and after. I now use your last variable $ a to marry only one.
No way. paste your code to see it.
If you don't like regular expressions, just intercept them.
$a = "yybb_cx.";$a = substr(substr($a,5),0,-1);echo $a;
No, No. I made a mistake. It shouldn't be before. You only need to underline the letter !!!!
$a = "yybb_cx.";$a = substr($a,5);echo $a;
$s = 'yybb_cx.';strtok($s, '_');$a = strtok('.');echo $a; //cx