I have this in PHP
$string="Thisissomekindofstringiwantthislolipop";
I want new string like this
$string="iwantthis";
But i have more string similar
$string1="Thisissomekindofstrigqqqqqqqqqkokiki";
And new string
$string1="qqqqqqqqq";
The value of letters at beggining is always the same, and i always need new string with same letters count, is posible to do that?
Txanks in advance
If you want to cut the string you should take a look on substr.
You can then cut the unneeded parts:
Update because of your comment:
You can also split a string by a delimiter (here: with explode). E.g.
Or even nicer. Just extracting the numeric id from the URL with a regular expression using preg_match_all:
This prints out