foreach and array need help combining


Posted on 16th Feb 2014 07:03 pm by admin

Hi guys.

Here's the code

Did you know?Explore Trending and Topic pages for more stories like this.
Code: array(
'tag' => 'code',
'type' => 'unparsed_content',
'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">
$1</pre>' : '$1') . '</div>',
),

And what I want to do is explode $1 & add something to the end of it (a new variable.

eg.

Code: $1 - $2
So here's my explode code, I'm getting errors wherever I place it.

Code: $2 = '';
$codeChunks = explode("n", $1);

foreach($codeChunks as $i => $chunk)
{
$2 .= "$chunk - <b><a href='http://mysite.com?id=$chunk' target='_blank'>Hyperlink</a></b>n";
}

So hopefully I end up with an output like this ....

Code: 1 - [url=http://mysite.com?id=1]Hyperlink[/url]
2 - [url=http://mysite.com?id=2]Hyperlink[/url]
3 - [url=http://mysite.com?id=3]Hyperlink[/url]
4 - [url=http://mysite.com?id=4]Hyperlink[/url]
5 - [url=http://mysite.com?id=5]Hyperlink[/url]
No comments posted yet

Your Answer:

Login to answer
108 Like 51 Dislike
Previous forums Next forums
Other forums

redirect standard error and assert (how to?)
How do you redirect standard error and assert?

---

(Why? I am creating an web app and

creating a 1 to 100 in a table
hi guys I am a newb in php need some help.

I have a table with 1 column and 100 rows and in

PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

Can I use a loop
Hi buddies!

Once again with my doubts here.

Right now I am using this sql stat

PRotect my POST DATA... FROM HTML ATTACKS
I need to like let's say

If a user submit's his Prayer and he put's <meta refresh stuf

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.

Code: $moderators = array('Admin', 'ba

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash