[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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