Ali Nouman
This is a site slogan
  • Twitter
  • Linkedin
  • Home
  • About Me
  • Blog
  • Portfolio
  • Contact Me
  • Home

Insert string at specified position| php

24 Oct

Insert string at specified position| php

By alinouman php 0 Comments
You can use following code to insert string at the specified position.
$newstr = substr_replace($oldstr, $str_to_insert, $pos, 0);
http://php.net/substr_replace The 4th argument being "0" causes the replaecment string to be inserted without overwriting any of the original string.

Share this post

Author

alinouman's picture

alinouman

Categories

  • .htaccess
  • ajax
  • angular
  • arrays
  • babel
  • Popular
  • Recent
  • Safely get a nested value inside an object
    Oct 08, 2016
  • How to remove a particular element from an array in JavaScript?
    Oct 08, 2016
  • Es 6 Trick to Swap values between two variables | Javascript to Swap values between two variables
    Oct 15, 2016
  • Writing Custom Callback for ajax
    Feb 15, 2017
  • Anonymous function assigned to variable vs a named function.
    Feb 04, 2017
  • Check if object value exists and set new value for object key | Code optimization
    Feb 01, 2017
Get In Touch

Newsletter

Keep up on our always evolving product features and technology. Enter your e-mail and subscribe to our newsletter.

Contact Me

  • Skype: ali.nouman92

  • Email: [email protected]

Follow Me

  • Twitter
  • Linkedin

© Copyright 2020 by Ali Nouman

  • Contact