• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

check if string contains any slashes

How do I check to see if a variable contains any slashes?
0
Solutionabc
Asked:
Solutionabc
1 Solution
 
d_j_twilightCommented:
Are you looking for forward (/) or back (\) slashes or both?
0
 
SolutionabcAuthor Commented:
both
0
 
rockiroadsCommented:
0
 
cyberkiwiCommented:
How do I check to see if a variable contains any slashes?

$containsslashes = ((strpos($mystring, "/") === false) && (strpos($mystring, "\\") === false));
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now