On 31/05/05, W Luke <[EMAIL PROTECTED]> wrote:
> On 31/05/05, Murray @ PlanetThoughtful <[EMAIL PROTECTED]> wrote:
> > > > >
> > > function replace($string){
> > > preg_match("/^<\^([a-zA-Z]+?)_([a-zA-Z]+?)>/", $string, $matcharr);
> > > $string = str_replace($matcharr[0], $matcharr[1]
On 31/05/05, Murray @ PlanetThoughtful <[EMAIL PROTECTED]> wrote:
> > >
> > function replace($string){
> > preg_match("/^<\^([a-zA-Z]+?)_([a-zA-Z]+?)>/", $string, $matcharr);
> > $string = str_replace($matcharr[0], $matcharr[1] . " " .$matcharr[2]
> > . ":", $string);
> > return
>
> function replace($string){
> preg_match("/^<\^([a-zA-Z]+?)_([a-zA-Z]+?)>/", $string, $matcharr);
> $string = str_replace($matcharr[0], $matcharr[1] . " " .$matcharr[2]
> . ":", $string);
> return $string;
>
> }
>
> $string = "<^JIM_JONES> Leicester, 1720. Oxford, 1800 CON
>
> function replace($string, $search)
> {
> $string = strstr($string, $search)
> $string = preg_replace("/(<|\^|>)/", "",$string);
> $string = str_replace("_", " ", $string);
> return $string;
>
> }
>
> $text = 'My name is <^JIM_JONES> and I like ice cream';
> $
On Mon, 2005-05-30 at 16:24, W Luke wrote:
> On 30/05/05, Brian V Bonini <[EMAIL PROTECTED]> wrote:
>
> [...]
>
> > > Again, an example that is as close to your real-world needs as possible
> > > would be very helpful.
> >
> > The original request was: "the text-to-replace is just in a var named
On 30/05/05, Brian V Bonini <[EMAIL PROTECTED]> wrote:
[...]
> > Again, an example that is as close to your real-world needs as possible
> > would be very helpful.
>
> The original request was: "the text-to-replace is just in a var named
> $text1".
>
> I read that to mean you'd already extracte
On Mon, 2005-05-30 at 15:24, Murray @ PlanetThoughtful wrote:
> > This is a great help, thanks to both. One question I have though.
> > How do I just leave the formatting "as is"? In the loop you gave me,
> > Brian...:
>
> [snippage]
>
> > I can't see how I can disregard strtolower without dis
> This is a great help, thanks to both. One question I have though.
> How do I just leave the formatting "as is"? In the loop you gave me,
> Brian...:
[snippage]
> I can't see how I can disregard strtolower without disrupting the rest
> of the function! My problem is $string contains a whole
On 30/05/05, Brian V Bonini <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-05-30 at 11:13, Murray @ PlanetThoughtful wrote:
> > > Someone much more clever that I can probably come up with something much
> > > cleaner and efficient but This works...
> >
> > Definitely not more clever and arguably not
On Mon, 2005-05-30 at 12:58, Murray @ PlanetThoughtful wrote:
>$string = "this";
> $string{0} = strtoupper($string{0});
> echo $string; // should return value of "This"
> ?>
I knew you could access but I didn't realize your could assign/replace
specific chars like that, i.e. $string{x} =
> AHHH! ucwords(); I probably looked right at it a million times.. I knew
> there had to be something to do that
Lol, I know that feeling well!
One thing, btw, looking at the solution you provided. Once you'd
preg_split()ed the string into component words, you could have simply
applied strtou
On Mon, 2005-05-30 at 11:13, Murray @ PlanetThoughtful wrote:
> > Someone much more clever that I can probably come up with something much
> > cleaner and efficient but This works...
>
> Definitely not more clever and arguably not more efficient, but a different
> way of handling this might be
> Someone much more clever that I can probably come up with something much
> cleaner and efficient but This works...
Definitely not more clever and arguably not more efficient, but a different
way of handling this might be:
)/", "",$string);
$string = str_replace("_", " ", $string);
$stri
On 30/05/05, Brian V Bonini <[EMAIL PROTECTED]> wrote:
> On Sun, 2005-05-29 at 12:22, W Luke wrote:
> > Hi,
> >
> > I have some text in a file which, when it's dumped to a var, needs to
> > be replaced. In its raw form, it looks like this: <^JIM_JONES> and I
> > need to remove the <^_ and > charac
On Sun, 2005-05-29 at 12:22, W Luke wrote:
> Hi,
>
> I have some text in a file which, when it's dumped to a var, needs to
> be replaced. In its raw form, it looks like this: <^JIM_JONES> and I
> need to remove the <^_ and > characters and have it read "Jim-Jones"
>
> It's nestled in amongst a l
15 matches
Mail list logo