Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:41:37+00:00 2026-06-04T05:41:37+00:00

I am tring to convert an array to string, than wanna change some chracters

  • 0

I am tring to convert an array to string, than wanna change some chracters with str_replace. Everything works fine except convertion. What is the proplem in my code?

function tr_cevir($text = "") {
    //converts turkish charters in to english chracters
    $TR = array('ç', 'Ç', 'ı', 'İ', 'ş', 'Ş', 'ğ', 'Ğ', 'ö', 'Ö', 'ü', 'Ü', 'I');
    $EN = array('c', 'c', 'i', 'i', 's', 's', 'g', 'g', 'o', 'o', 'u', 'u', 'i');
    $text = str_replace($TR, $EN, $text);
    $text = str_replace(" ", "", $text);
    return $text;
}

$my_array = array(çali, Şeli, Ğahmet);

$string = implode(", ", $my_array);

$string_converted = tr_cevir($string);

echo $string_converted; //output returns null

How can i get the output like:

cali,seli,gahmet

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:41:39+00:00Added an answer on June 4, 2026 at 5:41 am

    Try replacing your whole code with this:

    $my_array = array('çali', 'Şeli', 'Ğahmet');
    
    $string = implode(", ", $my_array);
    
    $string_converted = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $string);
    
    echo $string_converted;
    

    iconv()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert this string array to byte array. string[] _str= { 01,
I'm new in iPhone and I'm trying to convert NSMutable array to json string
I'm trying to convert this string : $json = '[{a:1,b:2,c:3,d:4,e:5}, {a:6,b:7,c:8,d:9,e:10}]'; To an array
Trying to convert int arrays to string arrays in numpy In [66]: a=array([0,33,4444522]) In
I'm trying to convert a string array of categorical variables to an integer array
How to extract and save array from string parameter? I'm trying convert string beafore_create
Here ,I am trying to convert map values into String array but i am
I am trying to convert a comma separated string into an array using the
Possible Duplicate: .NET String to byte Array C# How do I convert String to
When I try to convert a string to int array, i get a Null

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.