GetDotted Domains

Viewing Thread:
"PHP question"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 17/01/03 at 16:49
Regular
Posts: 787
ok,
if ive got a two strings
"friday - its the weekend"
"monday - back to work"

is there a PHP function or can i use a combination of functions to return just "friday" and "monday"

i can do it in VB, java and SQL but my PHP isnt up to scratch.

cheers guys
Fri 17/01/03 at 21:26
Regular
""
Posts: 303
$strFull = "Friday - its the weekend";
$strDay = substr(trim($strFull), 0, strpos(trim($strFull), "-") -1);

echo strDay; //returns "Friday"
Fri 17/01/03 at 17:11
Regular
"It goes so quickly"
Posts: 4,083
you could try something like this:

$Message = "friday - its the weekend";
if ( strstr($Message, "friday"))
print "$Message";
else
print "friday not found.";
Fri 17/01/03 at 17:01
Regular
""
Posts: 303
hmm, ive just found the functions strlen and strpos. reckon thatll do the job.
Fri 17/01/03 at 16:49
Regular
""
Posts: 303
ok,
if ive got a two strings
"friday - its the weekend"
"monday - back to work"

is there a PHP function or can i use a combination of functions to return just "friday" and "monday"

i can do it in VB, java and SQL but my PHP isnt up to scratch.

cheers guys

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Excellent support service!
I have always found the support staff to provide an excellent service on every occasion I've called.
Ben
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.