How to call function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bogel
Forum Newbie
Posts: 2
Joined: Mon Mar 20, 2006 10:22 am

How to call function

Post by bogel »

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm newbie in php...

Code: Select all

<?php
    function get_querycheck($string) {
    	global $QUERY_STRING;
    	if ($QUERY_STRING=='') {//assume no query string...
    		$newstring='?'.$string;
    		return $newstring;
    	} else {//assume there is a query string...
    		$newstring='?'.$QUERY_STRING.'&'.$string;
    		return $newstring;
    	}
    }
?>
I copy the function on PSC.
How to call the function to running on PHP?


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

$result = get_querycheck($someVar);

echo $result;
bogel
Forum Newbie
Posts: 2
Joined: Mon Mar 20, 2006 10:22 am

Thanks

Post by bogel »

Works!!

Thanks
Post Reply