0

I want to remove forward slash from below mentioned string using php

Output

$userheightfeet1 = $_POST["userheightfeet"];

5\'10

Expected O/P

  5'10
1

4 Answers 4

2

Use this

$userheightfeet1 = $_POST["userheightfeet"];

echo stripslashes($userheightfeet1);

Also you may use

$userheightfeet1 = $_POST["userheightfeet"];

echo str_replace('\','', $userheightfeet1);
Sign up to request clarification or add additional context in comments.

Comments

1
<?php
$str = "5\'10";

// 5'10
echo stripslashes($str);
?

Hope this helps!! :)

Comments

1

I have used give code it will help you :-

 $str="5\'10";
 $str=stripslashes($str);
 echo $str;

Comments

0

Use function

    str_replace(find,replace,string,count)

http://www.w3schools.com/php/func_string_str_replace.asp

Replace what ever character you want to replace with "".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.