Posts Tagged "50 PHP tips"

50+ PHP tips and tricks

echo is faster than print. Wrap your string in single quotes (’) instead of double quotes (”) is faster because PHP searches for variables inside “…” and not in ‘…’, use this when you’re not using variables you need evaluating in your string. Use sprintf instead of variables contained in double quotes, it’s about 10x faster. Use echo’s multiple parameters (or stacked) instead of string concatenation. Use pre-calculations, set the maximum value for your for-loops before and not in the…

Like to share it
Read More