<Original message>
From: Dan McCullough <[EMAIL PROTECTED]>
Date: Fri, Oct 26, 2001 at 06:03:00AM -0700
Message-ID: <[EMAIL PROTECTED]>
Subject: [PHP] String breaking up

> I was looking to take a string like Dan and return it like 
> D
> A
> N
> 
> is it the str function that does that
> 
> =====
> Dan McCullough
> -------------------------------------------------------------------
> "Theres no such thing as a problem unless the servers are on fire!"
> h: 603.444.9808
> w: McCullough Family
> w: At Work
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

</Original message>

<Reply>

Hi Dan,

This is what you're looking for:

$string = preg_replace ("/(.)/e", "strtoupper('\\1').\"<br>\"", $string);

See the example below:

---[ PHP Example ]---
<?php
$string = "Dan is great";
$string = preg_replace ("/(.)/e", "strtoupper('\\1').\"<br>\"", $string);
print ($string);
?>
---[ End of PHP Example ]---

Or is you don't want the upper case characters after all:

$string = preg_replace ("/(.)/", "\\1<br>", $string);

Again, see the example below:

---[ PHP Example ]---
<?php
$string = "Dan is great";
$string = preg_replace ("/(.)/", "\\1<br>", $string);
print ($string);
?>
---[ End of PHP Example ]---

Good luck!


</Reply>

-- 

* R&zE:


-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to