$a = 'name'; ${$a} = "Paul"; echo $name; echo '<br>'; function increment_value($y) { $y++; echo $y; } function increment_reference(&$y) { $y++; echo $y; } $x = 1; increment_value($x); // prints '2' echo '<br>'; echo $x; // prints '1' echo '<br>'; increment_reference($x); // prints '2' echo '<br>'; echo $x; // prints '2' echo '<br>'; $new = 'this is new'; $new_again = 'this is new again'; unset($new); /* if(isset($new)){
header('HTTP/1.1 400 Bad Request'); exit(0); } $ttids = find_item(forcedUriOnly(false, getDomain($uri)) ? $uri : null, $title, $artist, $album, $albumartist, forcedUriOnly(false, getDomain($uri))); if (count($ttids) == 0) { debuglog("Doing an INCREMENT action - Found NOTHING so creating hidden track", "USERRATING", 6); // So we need to create a new hidden track check_album_image(); $ttids[0] = create_new_track($title, $artist, $trackno, $duration, $albumartist, $albumuri, $image, $album, $date, $uri, null, null, null, null, md5($albumartist . " " . $album), null, $disc, null, $uri === null ? "local" : getDomain($uri), 1, $trackimage, 0); } if (count($ttids) > 0) { foreach ($ttids as $ttid) { debuglog("Doing an INCREMENT action - Found TTID " . $ttid, "USERRATING", 9); foreach ($attributes as $pair) { debuglog("(Increment) Setting " . $pair["attribute"] . " to " . $pair["value"] . " on " . $ttid, "USERRATING", 6); increment_value($ttid, $pair["attribute"], $pair["value"]); } $returninfo['metadata'] = get_all_data($ttid); $artist_created = false; $album_created = false; } print json_encode($returninfo); } break; case "add": // This is used for adding specific tracks so we need urionly to be true // We don't simply call into this using 'set' with urionly set to true // because that might result in the rating being changed $ttids = find_item($uri, $title, $artist, $album, $albumartist, true); // As we check by URI we can only have one result. $ttid = null;