Jump to content


Photo

Getting only Capital words


  • Please log in to reply
2 replies to this topic

#1 A584537

A584537
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 28 September 2006 - 01:24 PM

Hi, I'm using a C program to get a html page from a site, because I don't know how to use PHP sockets yet.
And, I'm using PHP to strip the tags and change   to a space and such.

What I need though, is to only get capitalised words. Here's an example:

CLERKS II

Sequel to Clerks. A calamity at Dante and Randall's shops sends them looking for new horizons...
CLICK

Michael Newman’s life is transformed when he is given a universal remote to control his life.
DIRTY SANCHEZ

An extreme version of Jackass.
I only want the movie titles, and luckily they are all capitalised.
I want to get the capitalised words out of a string, $contents2.

How would I go about this?

Cheers

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 28 September 2006 - 01:35 PM

I'd recommend a regular expression for this...

Try posting in the Regular Expression forum on this board and in the mean time check out the manual on it.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 28 September 2006 - 01:40 PM

To make text uppercase / lowercase like so...
ash => ASH
strtoloupper($var);

PAUL => paul
strtolower($var);




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users