Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

For Ray

In response to his question here, assuming your content is in a string called $content:

$num_paras = substr_count($content, '

'); switch ($num_paras) { case 1: $image = 'one.jpg'; break; case 2: $image = 'two.jpg'; break; case 3: $image = 'three.jpg'; break; default: $image = ''; break; }

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed