| | |
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 |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop open parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update upload url validation validator variable video web xml youtube





