Keverw
Keverw

Reputation: 3786

Detect if a string contains a period in php

How can I detect if a string contains a period . that is in the php variable?

Upvotes: 2

Views: 623

Answers (1)

cdhowie
cdhowie

Reputation: 169028

if (strpos($variable_to_search, ".") !== FALSE) {
    // The variable contains a period.
}

Upvotes: 10

Related Questions