tags:

views:

66

answers:

1

Hi there,

I wonder if there is a simplier way of injecting into a string.

so if i have the follow:

Guess what you

I'de need to inject the following so the string returns:

Guess what i know you

A way i would do this is to explode all the spaces and attach the strings seperatly via numbers but would there be a quicker more efficent way of doing this as this file i will be changing it quite big?

Cheers

A: 

I did it this way - has anyone got a better way?

    $fr = file('http://www.example.com');

    $fr[10] = '<div class="guarantee gsmall">';
    $fr[22] = '</div>';

    $fr[24] = '<div class="guarantee">';
    $fr[26] = '<h2 class="faqsubhead">Five most frequently asked questions<a name="tag1">&nbsp;</a></h2>';
    $fr[30] = '<ol class="faqmenu">';
    $fr[36] = '</ol>';
    $fr[37] = '</div><span class="faqsection">';

    //print_r($fr);
    echo implode(' ',$fr);
unknowntoyou
Does this have anything to do with the question?
Álvaro G. Vicario
@unknowntoyou Please *edit* your original question to provide additional information instead of providing the information in an answer. Also, the information you gave seems to be unrelated to the original question. While the question may be obvious to you, you should not assume it is to us too. If you want help, please be specific about your problem and what you are trying to do.
Gordon