0

I'm using CakePHP (v3.0) and I want to show on screen the variable value. I have tried to use print_r() function, but not always runs..

Whats would be the best option?

2 Answers 2

1

CakePHP comes with pr() function you can use that

Documentation link

Sign up to request clarification or add additional context in comments.

4 Comments

just try pr($numbers); die;
I have tried with this example and don't show nothing: $numbers = [1,2,3]; pr($numbers);
try $numbers = [1,2,3]; pr($numbers);die("text"); did that work ?
Now yes, I forgot die() function.. Thanks!
0

I always use cake's debug() function, but you should consider using DebugKit for debugging your app.

DebugKit

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.