kalabox Posted November 16, 2010 Report Share Posted November 16, 2010 (edited) Sveiki, tatad nezinu kā dabūt gatavu, ir parasta form lapa, kuraa ieraksta vārdu, vai uzvārdu vai iesauku utt.. Ir cilvēki kas ieraksta piem: jānis vajag lai izvadīts tiek Jānis Un ar garumzīmēm tā jaanis izvadiits tiek Jānis, kur sākt domas meklējumus? Ar lielajiem burtiem radās ideja, varētu katram burtam piem. a likt id 1 Datubāzē id 1 ir A Bet tā ir tāda primitīva ideja.. Edited November 16, 2010 by kalabox Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted November 16, 2010 Report Share Posted November 16, 2010 Pirmais burts uz lielo - http://php.net/manual/en/function.ucwords.php Par otro, lai to izdarītu ļoti precīzi, ir nepieciešama kāda datubāze ar izņēmumiem, bet tā http://www.php.net/manual/en/function.str-replace.php Quote Link to comment Share on other sites More sharing options...
kalabox Posted November 16, 2010 Author Report Share Posted November 16, 2010 (edited) nemaakuphp liels paldies :) Edited November 16, 2010 by kalabox Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 16, 2010 Report Share Posted November 16, 2010 Kalabox, tādiem sīkumiem datubāzei: fui! =P Lūk, speciāli Tev uzrakstīju funkciju...! =) function parse__letter_converter( $string ) { $letters = array( 'AA' => 'Ā', 'Aa' => 'Ā', 'aa' => 'ā', 'CH' => 'Č', 'Ch' => 'Č', 'ch' => 'č', 'EE' => 'Ē', 'Ee' => 'Ē', 'ee' => 'ē', 'GJ' => 'Ģ', 'Gj' => 'Ģ', 'gj' => 'ģ', 'II' => 'Ī', 'Ii' => 'Ī', 'ii' => 'ī', 'KJ' => 'Ķ', 'Kj' => 'Ķ', 'kj' => 'ķ', 'LJ' => 'Ļ', 'Lj' => 'Ļ', 'lj' => 'ļ', 'NJ' => 'Ņ', 'Nj' => 'Ņ', 'nj' => 'ņ', 'SH' => 'Š', 'Sh' => 'Š', 'sh' => 'š', 'UU' => 'Ū', 'Uu' => 'Ū', 'uu' => 'ū', 'ZH' => 'Ž', 'Zh' => 'Ž', 'zh' => 'ž' ); $string = strTr( $string, $letters ); return $string; } echo parse__letter_converter( 'Jaanis Aabele' ); Quote Link to comment Share on other sites More sharing options...
kalabox Posted November 17, 2010 Author Report Share Posted November 17, 2010 daGrevis shampis no manis - tencinu :) 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.