Hello, is there such a PHP function or an expression that would pace a period in a variable after the sign = (string variable and if there is = it took place, but the other part before = did not parse, thank you very much) I can not find answers on the Internet.
Answer 1, Authority 100%
Dana row and work with a string:
$ str = 'str = 1';
$ result = substr (STRSTR ($ str, '='), 1, strlen ($ STR));
Echo $ Result; # Will out: 1
or so:
$ str = 'str = 1';
$ result = substr ($ STR, STRPOS ($ str, '=') + 1, strlen ($ STR));
Echo $ Result; # Will out: 1
Answer 2, Authority 114%
Try (simplified without checks):
$ string_array = explode ("=", $ string);
echo $ string_array [1]; // line after equal
Answer 3, Authority 29%
$ str = "= 1 = 2 = 3 = 4";
preg_match_all ('| = (. +?) | is', $ str, $ Match);
VAR_DUMP ($ Match [1]);
Array (4) {
[0] = & gt;
String (1) "1"
[1] = & gt;
String (1) "2"
[2] = & gt;
String (1) "3"
[3] = & gt;
String (1) "4"
}