Jump to content

String variable


point86

Recommended Posts

Hi,

 

I have a string:

 

$query = $_GET['words'];

 

Where words are terms inputted by the user.

 

IE $query will be something like 'hello how are you'.

 

How do I get the system to search the string 'hello how are you' for SPACES (" ") and assign the number of spaces to a variable? EG in the string 'hello how are you', the number of spaces would be 3, and this would be assigned to eg $spaces.

 

Thanks

 

P86.

Link to comment
https://forums.phpfreaks.com/topic/38534-string-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.