Remove slash from a string

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
rohganAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
HuyBDConnect With a Mentor Commented:
if(strpos($str, '/')==1)
  $str=substr($str,2,strlen($str)-1)."/";
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.