str_replace

Reply

Join Date: Jun 2005
Posts: 44
Reputation: namit is an unknown quantity at this point 
Solved Threads: 0
namit namit is offline Offline
Light Poster

str_replace

 
0
  #1
Nov 7th, 2005
How do i use this str_replace with this

bla@bla.com
blac@bla.com
namit@namit.com
and so on

so i have setup

$email = str_replace(" ", ", ", $mail_list);

but it will only talk details if i do this

blac@bla.com bla@bla.com

It does not seam to find and replace return
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 80
Reputation: Daishi is an unknown quantity at this point 
Solved Threads: 2
Daishi Daishi is offline Offline
Junior Poster in Training

Re: str_replace

 
0
  #2
Nov 7th, 2005
Originally Posted by namit
How do i use this str_replace with this

bla@bla.com
blac@bla.com
namit@namit.com
and so on

so i have setup

$email = str_replace(" ", ", ", $mail_list);

but it will only talk details if i do this

blac@bla.com bla@bla.com

It does not seam to find and replace return
The 'return' character is not a space, it is '\n'.

-Fredric
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: str_replace

 
0
  #3
Nov 8th, 2005
Not sure how the email list are stored... If they are stored in txt file, then you can use fread to read each line of email address into a string:[php]$mail_list = '';
$handle = @fopen("/tmp/inputfile.txt", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 1024);
$mail_list .= $buffer.','; // email addresses
}
fclose($handle);
}[/php]
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC