RE: [PHP] Problem with a regex!

2001-01-27 Thread Dustin Butler
Zack, Your not going to find {title} when $var = "TITLE". Everything PHP is case sensitive. Also $string is not changed if there are matches, ereg_replace returns the modified string. HTH Dustin > I tried ereg_replace("\{" . $var . "\}",$value,$string) and > it didnt return >

RE: [PHP] Strange problem

2001-01-26 Thread Dustin Butler
There are FTP functions if it's an FTP download. You could also use socket functions to create the request if it's HTTP. Check your system for the utility called wget, you could exec() wget to retrieve the file also. Dustin > -Original Message- > From: Jeroen Jochems [mailto:[EMAIL PRO

RE: [PHP] Splitting at word count

2001-01-26 Thread Dustin Butler
> I'm doing a page where the front page will show "news" > stories. What I'd > like is if the story is longer than X words/chars/etc, the > index page will > show the first X words, then a link for the full story. > > Does anyone have a good idea on how to split after a certain number of > wor

RE: [PHP] how do you erase quotes from variable?

2001-01-26 Thread Dustin Butler
> I have a variable(s) that hold the string: > > "name" > > and I'd like to kill the quotes so it contains: > > name > > I am aware of the strlen() function but can find the concant > > Little Help? > > Mike If you *know* the variable is quoted you could also do: $new = substr($variable, 1

[PHP] exec() bug?

2001-01-25 Thread Dustin Butler
Hi, Can someone confirm this behavior on their system. I've tried it on 4.0.2 and 4.03pl1, both on Linux boxes, both with the same results. echo "One Character: " . exec("echo 't'",$tmp) . "\n"; echo "One Character: " . $tmp[0] . "\n"; echo "Two Characters: " . exec("echo 'te'",$tmp) . "\n"; My

Re[2]: [PHP] is it possible to communicate javascript and php?

2001-01-23 Thread Dustin Butler
I've used the tag in Internet Exploder to talk to the server via javascript. It may be possible using a regular frame also. Here's the low down on how I did it. 1.) Some onclick, onchange ... action calls a javascript function that looks like this function getData() { d