Web Analytics Made Easy -
StatCounter Replace cursive high comma out of textarea - CodingForum

Announcement

Collapse
No announcement yet.

Replace cursive high comma out of textarea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Replace cursive high comma out of textarea

    Hello,

    I want to change the time 1H05´24" into 1:05:24.

    Code:
    $time = '1H05´24"';
    $keys = array('1H', "´", '"', );
    $values   = array('1:', ':', '');
    $time = str_replace($keys, $values, $time);
    echo $time;
    The following code works fine. But when I get the output out of a textarea form the cursive high comma (´) won't replace anymore. Any idea how to solve this? I'm getting crazy.

  • #2
    Solved. The form wasn't accepting UTF-8 as I thought.

    Comment


    • #3
      mind that there are other characters than the backtick that could be used, e.g. the right single quotation mark (’) or the prime (′)
      The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
      André Behrens, NY Times Software Developer

      Comment

      Working...
      X