hi i want to copy specific string via string pos, and string len i need little help thanks (please not advise me about explode i am already know that it is very easy option for that) full string is : World Scientific;Expanded edition my need World Scientific i write sample code for this <?php $a='World Scientific;Expanded edition'; $strlen=strlen($a); $strpos=strpos($a, ';'); $strcopy=$strlen-$strpos ; echo $strlen.'</br>'; echo $strpos.'</br>'; ?> PHP:
emm $strpos=strpos($a, ';'); does give 16charactors count excluding ; Did you mean to use str_split() aswell <?php $a='World Scientific;Expanded edition'; $strpos=strpos($a, ';'); // = 16 $a2 = str_split($a, $strpos); // split the string from 16 charactors echo $a2[0]; // World Scientific ?> PHP: