Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
aperfectcirclefan
Nov 21, 2021

by Hand Knit
Professional PHP touchers...

Do you find yourselfs using private and public and constants with the language? I'm going through PHP Panda as a refresher for a interview I have next week and they devote alot of time towards that, but I don't think i've ever really used those properties.

Thanks for the help.

Adbot
ADBOT LOVES YOU

aperfectcirclefan
Nov 21, 2021

by Hand Knit
Nah not really, I'd perfer to use them since it makes the language more like Java or C#, but I didn't want to do it and then have people be like "What are you doing? I can't read this!".

aperfectcirclefan
Nov 21, 2021

by Hand Knit
Excellent alright, thank you very much.


It's hard to find what to expect for a PHP interview so I'm just hoping there isn't a bunch of algorithm questions lol.

aperfectcirclefan
Nov 21, 2021

by Hand Knit
Thank you all for the posts. I didn't actually know Interfaces were that highly used but thats good because I like using them. It seems like PHP has matured alot lately which is probably great for you hardcore PHP developers!

aperfectcirclefan
Nov 21, 2021

by Hand Knit
I've been getting some help in the WordPress thread with Gravity Forms but I feel bad bugging one person about it. Anyways, i'm trying to programatically reset the cost of some items to $0, and this code kinda works. Trouble is that I can't seem to get it to actually return the value out of the foreach loop. I feel like i'm missing something obvious. The price is correctly updated in the loop but outside it doesn't seem to want to update. Wondering if anyone can help. Thanks!!

code:
 function add_fee($product_info, $form, $lead){
		
       foreach($product_info['products'] as $key => $product){

           $getPrice = setProductPrice($key);

           if ($getPrice == True){
               $product['price'] = 0;
           }

//           print_r('<br>'. $product['name'] . ' ' .$product['price']);  
       }
       
       return $product_info;
    }

aperfectcirclefan
Nov 21, 2021

by Hand Knit
You're a genious omg you just saved me hours.

Adbot
ADBOT LOVES YOU

aperfectcirclefan
Nov 21, 2021

by Hand Knit
e; Figured it out! It was a error with the if then statement :v

aperfectcirclefan fucked around with this message at 21:47 on Apr 9, 2022

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply