Morphius Posted November 29, 2009 Report Share Posted November 29, 2009 (edited) Ar dažu labu funkciju no teksta tiek izvilkts simbolu sakopojums...kjkjteksts.5te Netieku skaidrs kā lai izvelk vārdu "teksts", respektīvi jāatņem no abām pusēm 4 simboli...pie nosacījuma ka šie simboli mainās... Sanāk tā ka šī rinda jāsadala pa burtiem un tad kaut kā mistiski jāatņem tie burti?! Idejas? Edited November 29, 2009 by Morphius Quote Link to comment Share on other sites More sharing options...
briedis Posted November 29, 2009 Report Share Posted November 29, 2009 <? $teksts = "adw.lalal, te ir baigais tekstiņš^op1"; echo mb_substr($teksts,4,mb_strlen($teksts,"utf-8")-8,"utf-8"); ?> Quote Link to comment Share on other sites More sharing options...
2easy Posted November 30, 2009 Report Share Posted November 30, 2009 (edited) var arī vienkāršāk ;) piemēri bez/ar utf-8 echo substr('1234bāblāblā1234', 4, -4) . '<br />'; // blāblāblā echo mb_substr('ššššbāblāblāčččč', 4, -4, 'utf-8') . '<br />'; // blāblāblā Edited November 30, 2009 by 2easy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.