Hello, I have over 1000 proxy IP's in an array, I want to add the word "deny from" before each ip, and echo it out so I have the full list of ips with deny from before it.
For example
323.232.12.32:3233
239.21.24.5:8080
67.3.25.66:90
i want to replace to
deny from 323.232.12.32:3233
deny from 239.21.24.5:8080
deny from 67.3.25.66:90
Is it possible to do this??
Thanks!!!
Adding somthing before words
Moderator: General Moderators
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
<?php
$proxy_ips = array(
'323.232.12.32:3233',
'239.21.24.5:8080',
'67.3.25.66:90'
);
for($k=0;$k<count($proxy_ips);$k++){
$proxy_ips[$k] = "deny from ".$proxy_ips[$k];
}
foreach($proxy_ips as $ip){
print $ip."<br/>";
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York