Code: [Select]
class person {
var $name = "Jimmy Goe";
function get_name(){
echo $this->name;
}
}
I am playing with this very small script that I made using a tutorial. I can get the script to echo out the name using the code above. What I don't get is why I can't do this
Code: [Select]class person {
var $name;
function get_name(){
$name = "Jimmy Goe"
echo $this->name;
}
}
then of course in my index page, I am calling it like this
Code: [Select$joe = new person();
$joe->get_name();
If you decide to answer this question, please be as detailed as possible, I am a newb as you can see and the more information you give or the simpler the explanation, the better.
Thanks for helping
Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interested in and put them in a variable, I end up with a few extra weird characters in my string that I
the problem with str_replace
$str="hahahahahahahahahahahahahaha";$nn=1;$str=str_replace('ha','MyGod',$str,$nn);echo $str;the result is MyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodWhy $nn has no
Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious... i.e. different devices has a similar configuration, but how I can discern it by device? Code: <config><device
retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and then i need to retrieve the keys of the top ten values. $array1 =
IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized he could reset my cron jobs...woohoo....Is there a way to get information from the server to make
Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting. How would I connect to the database on my hosting account? Currently I am using the following but
Getting Subdomain Name With PHP?
I want to grab the subdomain name with PHP so I can generate database queries.for example my subdomain is san-jose.mydomain.comHow would I go about grabbing the subdoman name with PHP? Thanks!
Data storage spaces in varchar2
Trying to understand what's happening.
Prevention Help
How can I use PHP or any other language (feel free to move this thread) to prevent users doing screenshots of the website (maybe Java??) so if anyone knows how I can achieve this please post. Or how
Need help making a script that moves data into acrhive table
Hi,I'm kinda new to php/mysqlAnd i wrote a simple script to store sales lead for a buisness and they are posted out into a table after they are submitted in a form. The page where you can see all your