| | |
str_replace
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2005
Posts: 44
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Aug 2005
Posts: 80
Reputation:
Solved Threads: 2
•
•
•
•
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
-Fredric
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]
$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.
![]() |
Similar Threads
- XML and str_replace ! (PHP)
- emoticon integration into shout box (PHP)
- phpBB thread archive (PHP)
- Find and Replace (Database Design)
- Help with a script (PHP)
Other Threads in the PHP Forum
- Previous Thread: Creating an else to a for loop
- Next Thread: Hey want to change header
| Thread Tools | Search this Thread |
.htaccess ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl customizableitems database date delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube





