Re: [PHP-DB] breaking apart data

2004-01-21 Thread Chris Boget
> Thanks Chris... that worked great.

No worries.
 
> Guess I need to spend a _lot_ more time reading the manual.

It also helps alot just lurking on the list (this and/or PHP general).
I've been coding with PHP for almost 6 years and there're still new
things I learn all the time.

Chris

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] breaking apart data

2004-01-20 Thread Larry R. Sieting
Thanks Chris... that worked great.

Guess I need to spend a _lot_ more time reading the manual.

At 11:28 AM 1/20/2004, Chris Boget wrote:
> duh (me)
> okay... I am wanting to wrap the lines of text in bullets and perform some
> text formatting on it (highlight, bold, underling, etc..) using css classes


  function bulletElements( &$arrElement, $key ) {
echo '
  • ' . $arrElement . '
  • ';

    }

    $str = "asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\nasdhfauiweuhrahsd \r\n";

    array_walk( explode( "\r\n", $str ), 'bulletElements' );

    That should do the trick. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Larry R. Sieting -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    Re: [PHP-DB] breaking apart data

    > duh (me)
    > okay... I am wanting to wrap the lines of text in bullets and perform some 
    > text formatting on it (highlight, bold, underling, etc..) using css classes
    
    
    
      function bulletElements( &$arrElement, $key ) {
    echo '
  • ' . $arrElement . '
  • '; } $str = "asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\nasdhfauiweuhrahsd \r\n"; array_walk( explode( "\r\n", $str ), 'bulletElements' ); That should do the trick. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    Re: [PHP-DB] breaking apart data

    You probably have more luck in a regular expression mailing list. Just an
    opinion.
    
    - Original Message -
    From: "Larry R. Sieting" <[EMAIL PROTECTED]>
    To: <[EMAIL PROTECTED]>
    Sent: Tuesday, January 20, 2004 4:17 PM
    Subject: Re: [PHP-DB] breaking apart data
    
    
    > duh (me)
    >
    > okay... I am wanting to wrap the lines of text in bullets and perform some
    > text formatting on it (highlight, bold, underling, etc..) using css
    classes
    >
    >
    >   At 11:12 AM 1/20/2004, you wrote:
    > >From: "Larry R. Sieting" <[EMAIL PROTECTED]>
    > >
    > > > what would be the most efficient way to rework this data in to what I
    am
    > > > after
    > > >
    > > > stored text:
    > > > asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n
    > > > asdhfauiweuhrahsd \r\n
    > > >
    > > > displays text as:
    > > > asdf asdf sadl jf lsakdjf a
    > > > asdfierw aweiufasd asiuwr
    > > > asdhfauiweuhrahsd
    > > >
    > > > I would like to highlight parts of the above.
    > >
    > >What do you mean by "highlight" it? And how do you know what parts need
    to
    > >be highlighted??
    > >
    > >---John Holmes...
    >
    > Larry R. Sieting
    >
    > --
    > PHP Database Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    >
    
    -- 
    PHP Database Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    
    
    

    Re: [PHP-DB] breaking apart data

    duh (me)
    
    okay... I am wanting to wrap the lines of text in bullets and perform some 
    text formatting on it (highlight, bold, underling, etc..) using css classes
    
     At 11:12 AM 1/20/2004, you wrote:
    From: "Larry R. Sieting" <[EMAIL PROTECTED]>
    
    > what would be the most efficient way to rework this data in to what I am
    > after
    >
    > stored text:
    > asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n
    > asdhfauiweuhrahsd \r\n
    >
    > displays text as:
    > asdf asdf sadl jf lsakdjf a
    > asdfierw aweiufasd asiuwr
    > asdhfauiweuhrahsd
    >
    > I would like to highlight parts of the above.
    What do you mean by "highlight" it? And how do you know what parts need to
    be highlighted??
    ---John Holmes...
    Larry R. Sieting
    
    --
    PHP Database Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    
    

    Re: [PHP-DB] breaking apart data

    From: "Larry R. Sieting" <[EMAIL PROTECTED]>
    
    > what would be the most efficient way to rework this data in to what I am
    > after
    >
    > stored text:
    > asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n
    > asdhfauiweuhrahsd \r\n
    >
    > displays text as:
    > asdf asdf sadl jf lsakdjf a
    > asdfierw aweiufasd asiuwr
    > asdhfauiweuhrahsd
    >
    > I would like to highlight parts of the above.
    
    What do you mean by "highlight" it? And how do you know what parts need to
    be highlighted??
    
    ---John Holmes...
    
    -- 
    PHP Database Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    
    
    

    [PHP-DB] breaking apart data

    HEllo,
    
    I have some data stored in a database (mysql) that I need to break 
    apart.  When I display it, I use the nl2br function.. works fine...
    
    but I want to do some formatting to each line of text and need to break it 
    apart.
    
    when I look at the raw data, it has the escape sequence \r\n (return\linfeed)
    
    what would be the most efficient way to rework this data in to what I am 
    after
    
    stored text:
    asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n 
    asdhfauiweuhrahsd \r\n
    
    displays text as:
    asdf asdf sadl jf lsakdjf a
    asdfierw aweiufasd asiuwr
    asdhfauiweuhrahsd
    I would like to highlight parts of the above.
    
    Larry R. Sieting
    
    --
    PHP Database Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php