Diyelim ki bazı iğne Char 'x' adlı Sonuçta karakter dönmek istiyorum diyelim:
$source_str = "Tuex helo babe".
Normalde ben bu yapardı:
if( ($x_pos = strpos($source_str, 'x')) !== FALSE )
$source_str = substr($source_str, $x_pos + 1);
Do you know a better/smarter (more elegant way) to do this?
Daha zarif ve belki de yavaş yapmazdım regexpi kullanmadan.
Ne yazık ki biz yapamaz:
$source_str = substr(source_str, strpos(source_str, 'x') + 1);
Becaue when 'x' is not found strpos returns FALSE (and not -1 like in JS).
FALSE would evaluate to zero, and 1st char would be always cutted off.
Teşekkürler,