Sorry, scrap that:
if (substr_count($mystring,"¶") >0)
John Taylor-Johnston wrote:
> How can I find out if $mystring includes the character "¶"?
> Thought substr would do it?
> J
--
John Taylor-Johnston
-
"If it's not o
* Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]):
> $P1OC1Q1 = "1¶some text or some comment";
>
> echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo
> $score[0]."\n";
>
> Do I have to go through all that to get score[0] ?
substr($P1OC1Q1, 0, strpos($P1OC1Q1, '¶')-1)
That will return
How can I find out if $mystring includes the character "¶"?
Thought substr would do it?
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Actually this does not work:
echo split($P1OC1Q1,"¶");
There are two variables in $P1OC1Q1 = "1¶a bucnh of text"
I want to split $P1OC1Q1 and get "1" as a numeral for a calculation. I was looking for
a cleaner way to do it.
$P1OC1Q1 = "1¶some text or some comment";
echo "Your score is: "; $scor
> Why not:
> echo "Your score is:
> ".split($P1OC1Q1,"¶")."\n";
Ok, but what happens when $P1OC1Q1 = "". It errors out.
$P1OC1Q1 = "";#left blank
$P1OC1Q2 = "1¶bunch of text";
$P1OC1Q3 = "1¶bunch of text";
$P1OC1Q4 = "1¶bunch of text";
$P1OC1Q5 = "1¶bunch of text";
$P1OC1Q6 = "1¶bunch of text";
Why not:
echo "Your score is:
".split($P1OC1Q1,"")."\n";
-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Sent: 17. ágúst 2003 03:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP] [php] explode that :) !
Kind of hoping to do shorten it like this:
echo "Your score is:
"
>echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo
>$score[0]."\n";
>
>Do I have to go through all that to get score[0] ?
I think reset(split()) should work for getting the first element.
-
michal migurski- contact info an
Kind of hoping to do shorten it like this:
echo "Your score is: ".$score[0]=split($P1OC1Q1,"¶")."\n";
No such hopes?
> Looks like a really simple piece of code except for the cryptic variable names.
>
> >$P1OC1Q1 = "1¶some text or some comment";
> >echo "Your score is: "; $score=split($P1OC1Q1,"
Looks like a really simple piece of code except for the cryptic variable
names.
John Taylor-Johnston wrote:
$P1OC1Q1 = "1¶some text or some comment";
echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo $score[0]."\n";
Do I have to go through all that to get score[0] ?
John
--
Radi
$P1OC1Q1 = "1¶some text or some comment";
echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo
$score[0]."\n";
Do I have to go through all that to get score[0] ?
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Just a note, in most cases where you have your own private /tmp it is
not the same /tmp PHP uses. You are in a chrooted or jailed environment
with a virtual /tmp where usually Apache runs outside this restricted
environment , the biggest reason being running a seperate set of Apache
processes
* Thus wrote Jaap van Ganswijk ([EMAIL PROTECTED]):
> At 2003-08-16 22:45 +, Curt Zirzow wrote:
> >* Thus wrote Jaap van Ganswijk ([EMAIL PROTECTED]):
> >> At 2003-08-16 23:28 +0200, Peda wrote:
> >>
> >> When you have a shell login, try this:
> >> - cd /tmp
> >> - chown .
> >>
> >> This pro
At 2003-08-16 23:05 +, Curt Zirzow wrote:
>* Thus wrote Binay Agarwal ([EMAIL PROTECTED]):
>> Hi everybody,
>>
>> Lot of places in manual i came across using "ereg_replace" or "ereg" is very
>> resource intensive and hence its better to use "preg_replace" or "str_replace" or
>> "strpos" if t
Have I over done this? Can I clean up this code any?
I have two states
1) Admin mode
2) Normal mode
in Normal mode, I have two states:
a) student is not in the database
a) student is in the database and has likely reloaded the browser. I'm trying to avoid
multiple entries with the same $Student
As others have pointed out already, your problem indeed is about not being
able to write in the tmp directory. Also, as others have pointed out, if
it's not your server you would not be able to change file permissions of the
/tmp directory. Your solution is probably found in changing the path where
At 2003-08-16 22:45 +, Curt Zirzow wrote:
>* Thus wrote Jaap van Ganswijk ([EMAIL PROTECTED]):
>> At 2003-08-16 23:28 +0200, Peda wrote:
>>
>> When you have a shell login, try this:
>> - cd /tmp
>> - chown .
>>
>> This probably gives an error warning.
>>
>> - chmod u+rw .
>
>Don't set your
* Thus wrote Binay Agarwal ([EMAIL PROTECTED]):
> Hi everybody,
>
> Lot of places in manual i came across using "ereg_replace" or "ereg" is very
> resource intensive and hence its better to use "preg_replace" or "str_replace" or
> "strpos" if they do the jobs.
>
I believe the use of ereg_repla
* Thus wrote Jaap van Ganswijk ([EMAIL PROTECTED]):
> At 2003-08-16 23:28 +0200, Peda wrote:
>
> When you have a shell login, try this:
> - cd /tmp
> - chown .
>
> This probably gives an error warning.
>
> - chmod u+rw .
Don't set your /tmp directoy to those settings. /tmp is a system
director
At 2003-08-16 14:35 +0200, J-K wrote:
>I've made a little script to make thumbnails which worked before the
>summer, but now I get this errormessage:
>
>Fatal error: Call to undefined function:
>imagecreatefromjpeg() in
>/usr/local/others/www.stud.users/mark/gfx/create_tn.php on line
>15
>
>First
At 2003-08-16 23:28 +0200, Peda wrote:
>I have some problem on my site.
>
>When I'm using this PHP script:
>
>session_start();
>session_register( "aUser", "aAccount" );
>$aUser = "Cidnie";
>$aAccount = "1016";
>?>
>" ); print( "Current Account: $aAccount
>" ); ?>
>
>Go to pa
Hi!!
I have some problem on my site.
When I'm using this PHP script:
Getting Started With Sessions: Page 1
" );
print( "Current Account: $aAccount" );
?>
Go to page 2
I'm getting this warning messages:
Warning: session_start(): open(/tmp/sess_cbd07ca5b53347ca5003404053754b
At 2003-08-15 09:31 -0700, Chris W. Parker wrote:
>Hello eveyone.
>
>I want to upgrade my php install from 4.2.2 to 4.3.2. I'm pretty new to
>linux so I don't know how to install from source and I haven't been able
>to find any Redhat 8 rpm's.
>
>Can someone please give me instructions as to what I
php-general Digest 16 Aug 2003 20:20:29 - Issue 2240
Topics (messages 159790 through 159804):
How to connect to DB
159790 by: murugesan
Re: call function as variable
159791 by: John W. Holmes
159797 by: adam
159798 by: David Otton
159799 by: Michael S
At 2003-08-15 15:12 -1000, Rodney Davis wrote:
>Does anyone know of a good howto on installing
>php w/ GD and phplib etc on a Redhat box?
I have just upgraded my (Mandrake) system by doing:
- Upgrading from Mandrake 9.0 to 9.1 using the CD's
that came with the UK Linux Format magazine of
june
You can just download the source distribution of php, and on a linux
commandline do:
grep -inr preg_replace *
You'll find all occurances of preg_replace, including it's declaratin, which
I have copies below. It seems like it's being passed thru to another
function .. Which is also on the same fil
Someone asked for the pop3 functions I put togather (lost your message),
please contact me off list, It works fine with my server but no
guaranties though there should be no problems.
I take the opportunity to express my 2 major problems I found with php
in the 2 months I've been using it.
First
Tanks a lot!
This was exactly that i wanted!
Cheers
David Otton wrote:
On Sat, 16 Aug 2003 07:58:27 +0200, you wrote:
I have folowing function which they are a member in a class.
function foo(){
something
}
function zoo(){
something else
}
and i have a array such:
$test = array(1=>foo,2=zoo);
Tanks a lot!
this is exactly that i want!!
Cheers
Michael Sims wrote:
On Sat, 16 Aug 2003 07:58:27 +0200, you wrote:
$test = array(1=>foo,2=zoo);
and i want to call the fuction foo() and zoo something like;
$object->$test[1]();
I've never used this myself, but this should work:
call_user_f
On Sat, 16 Aug 2003 07:58:27 +0200, you wrote:
>$test = array(1=>foo,2=zoo);
>
>and i want to call the fuction foo() and zoo something like;
>
>$object->$test[1]();
I've never used this myself, but this should work:
call_user_func(&$object, $test[1]);
See:
http://www.php.net/manual/en/function
On Sat, 16 Aug 2003 07:58:27 +0200, you wrote:
>I have folowing function which they are a member in a class.
>
>function foo(){
>something
>}
>
>function zoo(){
>something else
>}
>
>
>and i have a array such:
>
>$test = array(1=>foo,2=zoo);
>
>and i want to call the fuction foo() and zoo somethin
I got this error:
Parse error: parse error, unexpected '{' in ...
Cheers
John W. Holmes wrote:
adam wrote:
Hi!
I have folowing function which they are a member in a class.
function foo(){
something
}
function zoo(){
something else
}
and i have a array such:
$test = array(1=>foo,2=zoo);
Hi!
I've made a little script to make thumbnails which worked before the
summer, but now I get this errormessage:
Fatal error: Call to undefined function:
imagecreatefromjpeg() in
/usr/local/others/www.stud.users/mark/gfx/create_tn.php on line
15
First I thought they had
Then use a simple strstr to first find out if the string does contain
mydomain.com :-)
Jean-Christian IMbeault wrote:
I found this nice preg_replace function that replaces all occurrences
of an HTML anchor (
preg_replace(
"#
I'd like to modify this expression so that it does the same thing b
I found this nice preg_replace function that replaces all occurrences of
an HTML anchor (
preg_replace(
"#
I'd like to modify this expression so that it does the same thing but
*only* if the link is not to a specific page. I.e. I would like to
replace all links *unless* the link was to, for e
Try these :
preg_replace
http://www.weberdev.com/AdvancedSearch.php?searchtype=example&sort=examp
le&example=preg_replace
str_replace
http://www.weberdev.com/AdvancedSearch.php?searchtype=example&sort=examp
le&example=str_replace
strpos
http://www.weberdev.com/AdvancedSearch.php?searchtype=examp
Hi everybody,
Lot of places in manual i came across using "ereg_replace" or "ereg" is very resource
intensive and hence its better to use "preg_replace" or "str_replace" or "strpos" if
they do the jobs.
Now i am very curious to look at the source code (implementation) of these function so
as t
adam wrote:
Hi!
I have folowing function which they are a member in a class.
function foo(){
something
}
function zoo(){
something else
}
and i have a array such:
$test = array(1=>foo,2=zoo);
and i want to call the fuction foo() and zoo something like;
$object->$test[1]();
Try:
{$object->$tes
Hello all,
I have some existing php pages already. Now I want to change the DB
to point to another DB.
I have changed the include_path in php.ini file to point to /home/config
Also I changed the constant db_name defined in a file in
/home/config/con.php to point to new DB.
[snip]
php-general Digest 16 Aug 2003 08:16:35 - Issue 2239
Topics (messages 159743 through 159789):
Re: Segmentation Fault
159743 by: Jay Blanchard
159758 by: Curt Zirzow
Checkboxes
159744 by: Cesar Aracena
159745 by: Matt Babineau
159746 by: Cesar Aracena
typically problem!
have you used $this->tehotherfunction();
or just use therotherfunction();???
if you call from your class to a members method , you have use $this!!!
And read more about oo-method!
cheers
Donpro wrote:
Hi,
I have two functions in a class where one calls the other. When creati
40 matches
Mail list logo