Hi,

i am using the regular expressions in php. but i am facing some problem in that. i have input type='text' and i have 2 radio buttons one is Any word and second one is Exact word and i have one search button.

if i type in text field as(i.e., $var) and i select the radio button as EXACT WORD and i click the search button i want to display the all files in my folder which consists of $var only using regular expressions in php.

if i select the radio button as ANY WORD and i click the search button it should be displayed with the starting of $var contains data. using regular expressions in php.


pls help me.

Thanks,
Swap.

Just use an if statement.

eg.
if($radio_button=='exact'){
// DO THIS
}else if($radio_button=='any'){
// DO THIS
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.