hello, my question is how can I determine the position of the question mark in this string* and then separate it with the functionsubstr()
string = [Catálogo en línea?http://ur_prueba/index.jsp ]
hello, my question is how can I determine the position of the question mark in this string* and then separate it with the functionsubstr()
string = [Catálogo en línea?http://ur_prueba/index.jsp ]
You have several options:
Option 2:
For more information check the PHP documentation:
PHP Documentation
For me it is one of the best in terms of languages
With the "strpos" function you can get the position where the character you are looking for is, I suppose you want to extract the url, you would also have to remove the square bracket at the end, and the code would be like this
It seems to me that the most appropriate would be using explode() , using "?" how to delimit between the 2 string, in this way you get an array containing both parts:
thus:
$arr[0]
would contain the value:"[Catálogo en línea"
$arr[1]
would contain the value:"http://ur_prueba/index.jsp ]"
Example:
To get as output: