Advanced Search

Results 1 to 2 of 2

Thread: Dynamic Text Formatting

  1. #1
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Text Formatting

    I have a mysql database and am building php pages in dreamweaver cs4. The data in my database is in all caps so the data is apearing in all caps on my php pages. I am trying to figure out how to format the data so that it is not all uppercase but capitalized (meaning just the first letter is capitalized of each word).

    I also need to figure out how to format the dynamic text so that only the first letter of each sentance is capitalized.

    Again all letter area already capitalized so the css text-transform isn't working.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    This might be what your looking for http://www.php.net/manual/en/function.ucwords.php

    <?php
    $foo = 'hello world!';
    $foo = ucwords($foo); // Hello World!

    $bar = 'HELLO WORLD!';
    $bar = ucwords($bar); // HELLO WORLD!
    $bar = ucwords(strtolower($bar)); // Hello World!
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •