Regex String Replacement and Split using PHP

I have a sample string in PHP

$var = 'lurm limsrh domw en wonf src="@storage//user1/path/file.txt" and any lorm lipsm tjp quor it src="@storage//user2/path/file.txt" utt fine @storage// no chnge'; 

i have to want fillowing opration using PHP

  1. Replace only those @stroage// who is inside src="" to http://mydomain/folder/
  2. Replace all user to md5(user);. The username must comes afer @storage// ie it comes between '@storage//' to squencly frist '/' also replace only those who is inside src=""

Plz help me on regx expression use for same


Category: php Time: 2016-07-30 Views: 0

Related post

  • How to measure time interval in terms of hour,min,sec and days using PHP 2009-03-24

    I have two dates of the form: Start Date: 2007-03-24 End Date: 2009-06-26 Now I need to find the difference between these two in the following form: 2 years, 3 months and 2 days How can I do this in PHP? --------------Solutions------------- For PHP <

  • problem replacing and splitting string 2015-03-16

    I am trying to replace a pipe character used as a delimiter in a string. The string comes back with the pipe as the html entity code like this: Unassigned|Scheduled|Tech on Site Now, I'm trying to replace and/or split this string into a string list,

  • Optimizing string replacement program that uses recursion 2014-06-12

    I have the following string replacement program for a string of size 256: I am replacing the string "\'" with the string ' Please suggest any modifications if needed or any mistake I have done. #include <stdio.h> #include <string.h>

  • How to accomplish a task of evaluating editable variables and formulas, using PHP? 2015-09-22

    Task as defined: User needs to be able to define their own variables and formulas to operate on those variables, to get output based on their inputs. Since formulas and variables and their inputs change often, user needs to have control. Example //in

  • upload the document to notes and attachments using php toolkit salesforce 2015-12-10

    I am trying to do the integration using PHP Toolkit and creating a record in salesforce (Custom Object).I am having an issue Example :Let's say i have a candidate applying for the job .The Applicant needs to upload the resume and save as (Notes and a

  • How to delete and update using php 2016-02-05

    Hello guys I have been trying to delete a file using php and I want it to delete the main post, reply's and like then update to the author -10 in his/her point. Here is my code, using PDO: <?php session_start(); if(isset($_POST['id'])){ include($root

  • How to create duplicate form and save using php [on hold] 2016-02-15

    I need help, i need a form where i can duplicate one input, example user can have many phone number and save all of the phone numbers to databse using php please help. --------------Solutions------------- <?php $SERVER = ""; $USERNAME = "

  • Process a string with replacing and splitting 2011-12-29

    I have an input string like "123-45" or "1-3-5" or "2-4; 6-8" where the minus signed should be removed. This is easy with the xstring package. \StrSubstitute{#1}{-}{} The next step is to split the input strings at the semicol

  • Checking the file size and type using php 2016-01-15

    My assignment is to make a php file for uploading files to a directory. The user should only be able to upload a file if the file size is less than 512kb and the file type is txt, zip or jpg. My code is not working properly as it ignores the output i

  • User defined string literals and namespace use 2014-05-12

    I have a need to process URIs in one of my applications, sometimes from const char[] literals. My API: namespace net { class uri { ... }; // contains decomposed URI (path, parameters, etc) uri parse_uri(const std::string& uri_str); // parse string an

  • Find factors of the numbers between 3 and 100 using PHP 2016-01-19

    I am a beginner in PHP and I am trying to find the factors between 2 and 10 of the numbers between 3 and 100. If it is prime then say so. I can't figure out why my code is saying that all the numbers are prime except for multiples of 10, and even the

  • String concatenation and comparision using == 2016-01-20

    This question already has an answer here: How do I compare strings in Java? 23 answers why the result is false? could someone please explain? public class StringTest1 { public static void main(String[] args) { String a="a"; String b=a+"b&qu

  • Quickblox for android and web using PHP as backend 2016-02-17

    I was thinking of using the quickblox for my chat requirement. We want to build a 1-1 chat between a user and admin. User will be logged in from the android and admin will be logged in from the web. We want the functionality for the user to chat with

  • Reading the contents of the file and splitting using ksh 2013-02-05

    We're using a ksh script for installing one product. I've another config file, I'd need to read this configuration file from my main script Content of the Configuration file: BPWS_Instance_1:Linux:x86_64:YES:/hosting/download:BPWS_Linux_64.jar paymon

  • How to replace URL protocol using PHP? 2015-01-25

    I'm using HTTPS everywhere in my website but I have problems with sharing buttons for Pinterest and Tumblr. For example, when I try to share image on Pinterest I get this error: "Sorry we could not fetch the image." To make it work, I think I ne

  • How to update and insert using PHP? 2016-01-14

    I will start by showing you my code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>PHP1</title> <link href="css/main.css" rel="stylesheet" type="text/css"> <

  • Communication between Raspberry Pi , Arduino and Webserver using PHP 2016-01-18

    I am working on a project at the moment that hosts a webpage on a Raspberry Pi which I would like to send few commands to the Arduino via USB which makes LED's glow . The Communication between The Raspberry Pi and The Arduino is flawless . The only r

  • How to setup Twitter url - Splash page(static) - Actual article url (varying based on title and url) using php/MySQL (or any other language)? 2016-02-02

    How do I map the title and url with the splash page in between. For example: Twitter tweet: "Title + splash page url" After clicking on splash page url user goes to splash page for 3 seconds and is then redirected to actual article url. I have T

  • Y! Pipes: Fetch multiple feeds, after using string replace on Feed URL? 2010-10-27

    Here's what I'm trying to do: I have a private or user defined string. I would like to define a list of URLs, such as:{REPLACE_ME}{REPLACE_ME}{REPLACE_ME} These URLs are to

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 2.183 (s). 13 q(s)