str_replace

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

hal7
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jun 09, 2011 12:11 pm

str_replace

Postby hal7 » Mon Mar 04, 2013 6:30 am

Hi!

I have problem with viewing Turkish characters, so I am trying to use str_replace function to replace that wierd symbols with Turkish character but I can't get there.. :help:

I have a form like:

Code: Select all

<p><h3>*İlan Başlığı:</h3><input type="text" name="album_header" class="MustField" /></p>
<p><h3>*İsim:</h3><input type="text" name="album_name" class="MustField" /> </p>
<p><h3>*Şehir</h3><input type="text" name="album_place" class="MustField"  /> </p>
<p><h3>*E-mail:</h3><input type="text" name="album_email" class="MustField"  /></p>
<p><h3>Telefon:</h3><input type="text" name="album_tel"  /></p>
<p><input type="submit" id="submit" value="İlanı Yayınla" /> </p>


And I am trying str_replace like:

Code: Select all

if (isset($_POST['submit'])) {
   
$str = $album_header = $_POST['album_header'];
         $album_name = $_POST['album_name'];
       $album_place = $_POST['album_place'];
       $album_email = $_POST['album_email'];                                         
       $album_tel = $_POST['album_tel'];
}
function tr2tr($str){ 
           $str = str_replace("ı","ý",$str);
           $str = str_replace("ş","Þ",$str);
           $str = str_replace("ğ","ð",$str);
      return $str;
    }


I am not sure what I am doing here..But I still get wierd characters in stead of Turkish ones.

Can anyone help please?

User avatar
aravindoptimus
New php-forum User
New php-forum User
Posts: 11
Joined: Thu Mar 07, 2013 2:00 am
Contact:

Re: str_replace

Postby aravindoptimus » Thu Mar 07, 2013 4:54 am

You can try explicitly adding content type at the top of your file as below
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

With out using str_replace the character will show correctly I hope. :?

hal7
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jun 09, 2011 12:11 pm

Re: str_replace

Postby hal7 » Thu Mar 07, 2013 8:45 am

aravindoptimus wrote:You can try explicitly adding content type at the top of your file as below
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

With out using str_replace the character will show correctly I hope. :?



Because encoding options don't work I am trying this method.

But Thanx anyway!


Return to “phpMyAdmin”

Who is online

Users browsing this forum: No registered users and 1 guest

cron