Re: [Techකතා] මට word එකකින් අකුර අකුර වෙනම ගන්න ඕනේ (PHP)

13 views
Skip to first unread message

Kalinga Athulathmudali

unread,
Aug 20, 2012, 1:30:36 PM8/20/12
to tech...@googlegroups.com
2012/8/20 aruna1234 <aar...@gmail.com>
>
> Mata word එකකින් අකුර අකුර වෙනම ගන්න ඕනේ. PHP වලින් කොහමද ඕක කරන්නේ?
> ඒ කිව්වේ මෙහෙම. අපි හිතමුකෝ user කෙනෙක් techkatha කියල enter කරා කියලා. මට වෙන වෙනම අකුරු ටික ගන්න ඕනේ.
> EX :
> $letter1=t;
> $letter2=e;
> $letter3=c;
> $letter4=h;
> $letter5=k;
> $letter6=a;
> $letter7=t;
> $letter8=h;
>
> ඔන්න ඔය විදියට මට Variables වලට දාගන්න ඕනේ. කොහමද දාගන්නේ?

$word = "techkatha";

$array = str_split($word);

will put each letter in to an array

so

echo $array[0];
will be t
echo $array[1];
will be e
echo $array[2];
will be c

so on]


--
කාලිංග ඇතුලත්මුදලි.
http://www.kalingasblog.com
Follow me on Twitter http://twitter.com/kalinga
තාක්ෂණය ඔබට අරියාදු කරනවාද? http://www.techkatha.com
සිංහල බ්ලොග් කියවමු http://blogs.sinhalabloggers.com
සිංහල Geek Chat http://techkatha.com/chat/

Reply all
Reply to author
Forward
0 new messages