Jump to content
php.lv forumi

Burti


kalabox

Recommended Posts

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 by kalabox
Link to comment
Share on other sites

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' );

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...