Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

php string manipulation

Posted on 2014-01-08
2
Medium Priority
?
414 Views
Last Modified: 2014-01-08
I need help with a php function to maniuplate a string as such:

Replace all "." with "//"
Replace the "@" symbol with "/"
Reverse the text

input: myemail@site.com.au
output: ua//moc//etis/liameym
0
Comment
Question by:joomla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 800 total points
ID: 39767201
function <name-here>($input) {
  $needle = array(".", "@");
  $repl = array("//", "/");
  return strrev(str_replace($needle, $repl, $input));
}

HTH,
Dan
0
 

Author Closing Comment

by:joomla
ID: 39767233
thanks for the script.... it will help with lots of other requirements too.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question