Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-09-08, 01:36 PM
Junior Member
 
Join Date: Sep 2004
Posts: 2
slipnslidemaster
Default



I fixed it.

Slipnslidemaster
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2004-09-08, 01:48 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

post the function set_var()
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2004-09-08, 01:52 PM
Junior Member
 
Join Date: Sep 2004
Posts: 2
slipnslidemaster
Default

Code:
 /******************************************************************************
 * This functions sets the value of a variable.
 *
 * It may be called with either a varname and a value as two strings or an
 * an associative array with the key being the varname and the value being
 * the new variable value.
 *
 * The function inserts the new value of the variable into the $varkeys and
 * $varvals hashes. It is not necessary for a variable to exist in these hashes
 * before calling this function.
 *
 * An optional third parameter allows the value for each varname to be appended
 * to the existing variable instead of replacing it. The default is to replace.
 * This feature was introduced after the 7.2d release.
 *
 *
 * usage: set_var(string $varname, [string $value = ""], [boolean $append = false])
 * or
 * usage: set_var(array $varname = (string $varname => string $value), [mixed $dummy_var], [boolean $append = false])
 *
 * @param   $varname   either a string containing a varname or a hash of varname/value pairs.
 * @param   $value    if $varname is a string this contains the new value for the variable otherwise this parameter is ignored
 * @param   $append    if true, the value is appended to the variable's existing value
 * @access  public
 * @return  void
 */
 function set_var($varname, $value = "", $append = false) {
  if (!is_array($varname)) {
   if (!empty($varname)) {
    if ($this->debug & 1) {
     printf("<b>set_var:</b> (with scalar) <b>%s</b> = '%s'<br>\n", $varname, htmlentities($value));
    }
    $this->varkeys[$varname] = "/".$this->varname($varname)."/";
    if ($append && isset($this->varvals[$varname])) {
     $this->varvals[$varname] .= $value;
    } else {
     $this->varvals[$varname] = $value;
    }
   }
  } else {
   reset($varname);
   while (list($k, $v) = each($varname)) {
    if (!empty($k)) {
     if ($this->debug & 1) {
      printf("<b>set_var:</b> (with array) <b>%s</b> = '%s'<br>\n", $k, htmlentities($v));
     }
     $this->varkeys[$k] = "/".$this->varname($k)."/";
     if ($append && isset($this->varvals[$k])) {
      $this->varvals[$k] .= $v;
     } else {
      $this->varvals[$k] = $v;
     }
    }
   }
  }
 }
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:33 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.