For example if i tried to echo $input outside of the function, PHP would throw an error because i have not created that variable outside of the function. So note that variables created in a function (including the arguments) can only be used inside that function. Variables declared outside of a function can only be used outside of functions (unless you use them as an argument of course).That said, there is a command that allows you, in a function, to use a variable created outside a function. That command is "global", in the code above we use global with the variable $num so we could change it or access its value in our function. If you test the code, you will get the values 50 and 240. Build your own function that is really useful. Use them in your future PHP projects. Using functions can improve code modularity and the size of the overall project.
++++++++++
One-sentence summary -- Add three lines of code to your script. Add these before any other code at the beginning of your function. Add this line right after the closing curly brace of your function. For sake of clarity here is the entire code sample. A variable declared inside a function cannot be used outside the function. Play around with functions!


Many emo hair styles start with a deep side part. Hold a comb up at the outside of your eyebrow, then slide the comb through your hair from your hairline to the crown of your head. Comb your hair on either side of the part and use hairspray to hold your hair in place. If you have long bangs, part them so they'll fall over one eye. After you part your hair, take the front section of your hair and comb it slightly forward to it falls across your forehead. Sweep the hair to the side so it looks like long bangs, then use bobby pins near your ear to hold the hair in place. Most emo hair is worn straight to emphasize the choppy layers. If your hair is naturally curly or wavy, you can straighten your hair with a flat iron. You can also wear it natural and only straighten your bangs. to get extra volume at the top. Lift a section of your hair, then comb it backwards towards the roots. Do this several times until you see a visible lift in your hair. Carefully smooth the very top layer of your hair over the backcombed section, then hairspray it to hold it in place.  You can also purchase a root volumizer at a drug store or beauty supply store to help you get more lift. These are usually a powder or foam that you apply to the roots of your hair. Backcombing damages your hair and makes it more susceptible to tangling, so do not do this regularly. Emo hairstyles are often accented with colorful plastic barrettes. Popular barrette styles include brightly-colored bows and plastic skulls. Wear them clipped into your bangs or just above your ear. Most emo kids dye their hair black or bleach it platinum blonde, usually with some brightly-colored accents mixed in. Some popular color combinations are black with blue or red streaks and blonde with pink streaks or darker horizontal stripes, known as “coon tails." Don’t feel pressured to do this, though — plenty of emo kids embrace their natural hair color.  If you’ve never dyed your hair before, consider visiting a salon to have it professionally done. If you want to dye your hair at home, make sure you carefully follow all packaging instructions. To get the look without the commitment, try colorful clip-on extensions or temporary hair color like hair chalk or colored hair spray.
++++++++++
One-sentence summary -- Give yourself a deep side part. Use bobby pins to get the look of bangs if you don't have them. Wear your hair super-straight or wavy with straight bangs. Backcomb your hair Use cute hair accessories if you want. Experiment with your hair color.


This will make the soap easier to melt in the next step. Some melt-and-pour soap bases have a grid molded into them; you can use this as a cutting guide. You can use any type of base you want. White glycerin is popular, but goat milk or shea butter would be more luxurious! Place the cubes into a glass, microwave-safe bowl. Heat them in the microwave at 15 to 30-second intervals until the soap base melts. Stir the base between each interval. Plan on using about 1 teaspoon. This will give your soap a bright, golden-yellow color. If you want something deeper, you can add in a little bit more. You will need 2 teaspoons total of  either oil. You can use just one type of oil or a combination of 2 to 3 oils for a unique fragrance. Great choices include lemon and lavender. Thyme essential oil pairs especially well with turmeric.  For a more subtle fragrance, use less essential oil. If you are using essential oils instead of soap making fragrance oils, make sure that they are skin safe. Do not use candle-making fragrance oils. They are not the same thing, nor are they skin-safe. A great choice would be ground oatmeal because of how beneficial it is for skin, especially acne-prone skin. You can also use other exfoliants as well, such as ground apricot seeds, which you can get in the soap making section of an arts and crafts store. Plan on using about 1 tablespoon of your desired exfoliant. Keep stirring until the color and texture are consistent. Scrape the bottom and sides of the bowl often. If you added in an exfoliant, be aware that it may settle. This is normal. Use the rubber spatula to help scrape the bowl clean so that you don't waste any of your soap base. You can find soap making molds in the soap making aisle of an arts and crafts shop. You can also find them in online stores that specialize in soap making supplies. Make sure that the soap is less than 145°F (63°C) before pouring it into plastic molds, or the molds may warp. This will bring any air bubbles to the surface. If you see any, lightly mist them with rubbing alcohol. Do not put them into the fridge or freezer. Even though this seems like a good idea, it will affect the interior temperature of your fridge or freezer. Your food may also get a soapy taste. For a smoother finish, cover the top of the soap with plastic wrap before setting it aside to cool. Be sure to press the wrap into the soap. If the soap is hard to remove, you can put it into the freezer for up to 1 hour. This will help loosen the soap from the mold. Since the soap is already cooled off, it won't affect the interior temperature of your freezer. It also won't be long enough for it to impart a soapy flavor. If you used a lager mold, cut the soap into smaller bars using a sharp knife. You should be able to get about 6 to 8 bars. Unlike cold process soap, melt-and-pour soap does not require a curing time. Once you de-mold the soap, it is ready to use!
++++++++++
One-sentence summary --
Cut the melt-and-pour soap base into 1-inch (2.54-centimeter) chunks. Melt the soap base in the microwave. Stir in the ground turmeric. Add in some essential oil or soap making fragrance oil. Add in an exfoliant, if desired. Stir everything together with a rubber spatula. Pour the soap into a plastic or silicone soap making mold. Tap the mold gently. Allow the soap to cool for 12 to 24 hours. De-mold the soap. Use the soap.