Solved

Remove slash from a string

Posted on 2006-11-28
1
1,035 Views
Last Modified: 2012-08-13
I have a php string. Sometimes it contains a slash in the beginning.

How do I :
- Check if the start of string is space followed by slash or just slash
- If so remove the slash from beginning and move it to the end

String is stored in variable called $header
0
Comment
Question by:rohgan
1 Comment
 
LVL 17

Accepted Solution

by:
HuyBD earned 500 total points
ID: 18033890
if(strpos($str, '/')==1)
  $str=substr($str,2,strlen($str)-1)."/";
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
paypal ipn to mysql 3 38
php convert date format 3 21
google map tracking website 5 24
Checkout Page Input Field not aligned 1 23
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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