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 8843295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:11:04+00:00 2026-06-14T11:11:04+00:00

$string = this is my message in 12-10-12, Orlando i want to convert it

  • 0
$string = this is my message in 12-10-12, Orlando

i want to convert it to $new = this is my message in 12th October 2012, Orlando.

Please help me with php code

  • 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-14T11:11:05+00:00Added an answer on June 14, 2026 at 11:11 am

    This should get you started:

    function convert_date($hit)
    {
        $date = DateTime::createFromFormat("y-m-d", $hit[0]);
    
        if (!$date) //invalid date supplied, return original string
            return $hit[0]; 
    
        return $date->format("jS F Y");
    }
    
    $string = "this is my message in 12-10-12, Orlando or maybe 13-11-21";
    $string = preg_replace_callback("~(\d{2}-\d{2}-\d{2})~", "convert_date", $string);
    echo $string; //this is my message in 12th October 2012, Orlando or maybe 21st November 2013
    

    Look at the php date modifiers, the DateTime extension and preg_replace_callback for further information.

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

Sidebar

Related Questions

This is my code : public void AddToGrid(string value) { MessageBox.Show(value); //Message is showing
everyone. I have a string like this String message = This is the new
Parsing the string message seems bad. Or was this exception not meant to be
I have this delegate in C#. public delegate string ACSharpDelegate(string message); How would I
Given a string like so: Hello {FIRST_NAME}, this is a personalized message for you.
Suppose I have a function like this (I use akka 2.0.2): def foo(message: String):
here is my question, this is my string: var body = { message: Hello,
I am currently doing something like this: myFunc(tracer); function tracer(message:String):void{ trace(message); } function myFunc(callback:Function):void{
I would like concatenate string literals and ints, like this: string message(That value should
If I had a string declared like this: message db ABCDEFGHIJ,0 how could I

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.