How to read string from a specific word?

0

My question is as follows:

If I have the phrase "The mouse rooted the clothes of the king of Rome"

How do I read only from "Roe" to "Rome"?

This without using numbers, because they will be several sentences of different sizes.

I searched the php documentation for the strings functions I found several but could not do exactly that.

For an even more practical example, what I actually have is a list of links but they are like

/79811/out.php=www.youtube.com=?video1 /798354664561/out.php=www.youtube.com=?video1

These strings have different widths and I want to get the www to the end of the string

    
asked by anonymous 02.03.2017 / 21:00

2 answers

1

How about this?

$a = '79811/out.php=www.youtube.com=?video1';
$b = 'www';
echo substr( $a, strpos($a, $b);
    
02.03.2017 / 21:10
0

display from "3" to "8"

$frase = "123456789";


$primeira = strripos("$frase", '3');
$utima    = strripos("$frase", '8');

    $retirar = $utima - $primeira ;
    $exibir = substr($frase, $primeira, $retirar);

    echo "$exibir" ;


 exibir : 34567
    
03.03.2017 / 16:09