Strip all the contents in a string from a particular word - Php

Strip string

Snippet Code


  
Rate this page :
  [ 0 votes]

The output will be "we want" since all the contents starting from the word 'two' is stripped out.

$content="we want two apple"; $ipos=strripos($content,'two'); $content=substr_replace($content,"",$ipos);

Tags


Ask Questions

Ask Question