Jordi Canals wrote:
Student wrote:
I want to trim the following text
[i:abcdef]
Hi,
You can do:
$data = '[i:something]';
$array_data = explode(':',$data);
and you will have:
'[i' in $array_data[0]
'something]' in $array_data[1]
If i understod corretly, you want to get only something, so you need
$
Assuming you are doing just one string at a time:
$regex = "/(\[i:)(\w+)(\])/i";
preg_match($regex, $str, $matches);
print $str;//original string
print substr($matches[2], 1, 3);//trimmed string
?>
Gryffyn, Trevor wrote:
If the format is consistantly the same, try this:
$somedata = "[i:aslkdfj]";
If the format is consistantly the same, try this:
$somedata = "[i:aslkdfj]";
$insidedata = substr($somedata,3,strlen($somedata)-4);
-TG
> -Original Message-
> From: Student [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 17, 2004 11:42 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subje
Student wrote:
I want to trim the following text
[i:abcdef]
but the inside text is different at time eg abcdef, bcdefg, etc etc
how can i trim [i:(some text here)] so that i can replace them with nothing.
eg these are to be trimmed.
[i:abcdef]
[i:bcdefg]
[i:xyzab]
[i:priftds]
how can i trim them..
thanks...
it works...
From: Donatas <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] i need help
Date: Thu, 27 Nov 2003 18:28:26 +0200
It doesn't work coz you need to do it this way:
echo("Your username = ". *$_GET ['username']*."");
e
Try use $HTTP_GET_VARS["password"] or $_GET["password"]
> -Original Message-
> From: Hasan Barýþ Karayel [mailto:[EMAIL PROTECTED]
> Sent: den 27 november 2003 17:26
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] i need help
>
> Hi
> i am new in PHP...
> i made very a simple code but it d
Do you have register_globals on?
If not, try this:
Your username = " . $HTTP_GET_VARS['username'] . "";
echo "Your password = " . $HTTP_GET_VARS['password'] . "";
?>
Regards
Mike
-Original Message-
From: Hasan Barýþ Karayel [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 1
Disregard those stars... I guess this is a bug in my mail app or php-win
mailing list, it should have been bold instead.
Donatas wrote:
It doesn't work coz you need to do it this way:
echo("Your username = ". *$_GET ['username']*."");
echo("Your password = ". *$_GET ['password']*."");
you use $_
It doesn't work coz you need to do it this way:
echo("Your username = ". *$_GET ['username']*."");
echo("Your password = ". *$_GET ['password']*."");
you use $_GET ['']; superglobal array for values passed via link or form
where type is get or $_POST ['']; if you get info from a form via post
met
thanks for the help. got it to work
"Brother - Martin Bagge" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Anyang:
>
> > it's giving me this now:
> > Notice: Undefined index: game in C:\Xitami\webpages\index.php on line
> > 5 Notice: Undefined index: game in
>>
>>>>if (!$_GET["game"]) {
>>>>include("public.html");
>>>>}
>>>>if ($_GET["game"] != NULL && $op != NULL) {
>>>>include("http://mywebsite.com/example/"; . "$game" . ".
Anyang:
> it's giving me this now:
> Notice: Undefined index: game in C:\Xitami\webpages\index.php on line
> 5 Notice: Undefined index: game in C:\Xitami\webpages\index.php on
> line 8
>
> because i'm opening index.php without using ?game=
> is there anything I can do to not get it to say that?
) {
> > > > include("http://mywebsite.com/example/"; . "$game" . ".html");
> > > > }
>
> or post instead of get in there?
>
> > -Original Message-
> > From: Anyang [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 2 Oct
gt; > include("public.html");
> > > > }
> > > > if ($_GET["game"] != NULL && $op != NULL) {
> > > > include("http://mywebsite.com/example/"; . "$game" . ".html");
> > > > }
>
if ($_GET["game"] != NULL && $op != NULL) {
> > > include("http://mywebsite.com/example/"; . "$game" . ".html");
> > > }
or post instead of get in there?
> -Original Message-
> From: Anyang [mailto:[EMAIL PROTECTED]]
&g
how r u getting $game? that's the undefind var.
> -Original Message-
> From: Anyang [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 2 October 2002 11:38 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] i need help with an undefined variable
>
>
> I wrote a php script for a page that I hosted
Like i said, the other server understood it at a function of the address bar
so if index.php?game=foobar then $game = foobar and it would refresh the
page with the foobar page in the center. This is what I want to do.
"Peter Houchin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[
Read one line from the text file at a time.
Then use explode to separate it by semicolons.
Haven't ever done it from a text file myself, but something SIMILAR to this
should work:
\n";
print "$str1\n";
print "$int1\n";
print "$str2\n";
print " \n";
}
?>
At 03:45 PM
Alain Menard wrote:
> I clicked on the send button to fast...
>
> The part that i'm having problem with is the second part. Especially the one
> about the first string becomming a link to the corresponding URL.
>
> ""Alain Menard"" <[EMAIL PROTECTED]> wrote in message
> 9dv3k5$873$[EMAIL PROTECTE
They way I handled something like this was, I read the line in with
fread breaking it up into "$chunks"
$chunk1 = fread( $fp, 12); //Your string#1
$chunk2 = fread( $fp, 11); //The URL
$chunk3 = fread( $fp, 5); //the INT
$chunk4 = fread( $fp, 50); //The final Stri
I clicked on the send button to fast...
The part that i'm having problem with is the second part. Especially the one
about the first string becomming a link to the corresponding URL.
""Alain Menard"" <[EMAIL PROTECTED]> wrote in message
9dv3k5$873$[EMAIL PROTECTED]">news:9dv3k5$873$[EMAIL PROTE
21 matches
Mail list logo