Question: I found it in [dictionary.cambridge.org](http://dictionary.cambridge.org/grammar/british-grammar/if-only):

> 
> If only he knew the truth. (he doesn’t know the truth, but **he** wishes he did)
> 
> 
> 

It sounds to me that it means **I**, instead of he, wish he did know the truth. Can any one explain it to me?

Answer: 
> 
> If only he knew the truth. (he doesn’t know the truth, but he wishes he did)
> 
> 
> 

That's kind of misleading for dictionary.cambridge.org to say. Where's our edit button? :-/

It does mean "he doesn't know the truth", but without further context you can't assume it means "he wishes he did".

As @ColinFine says, in a narrative where "he" is the character we are following thinking out loud, then yes it would mean that:

```
Detective Jones looked over the jumbled papers on his desk, trying
to make sense of the murder case.  If only he knew the truth.

```

Here, "if only he knew the truth" is the detective thinking it would be better if he did. Then he could put the killer behind bars and put all this behind him, or whatever.

But if it's talking about someone else, it is kind of "wondering out loud" about what kind of difference it would make if the person were more informed:

```
That character on the TV show believes his wife is faithful to him.
If only he knew the truth.

```

So in that sentence, the "if only" is wondering out loud about how someone's life or actions might be different if they had more information. You would read it more-or-less as: *"If he knew his wife was cheating on him, things would be turning out differently."*
It could be either, depending on context. 

If it is not in a narrative, you're probably right. But in a narrative, if 'he' is the viewpoint character, it could mean that he wished he knew the truth.