• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 496
  • 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
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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