فَبَدَأَ بِأَوْعِيَتِهِمْ قَبْلَ وِعَآءِ أَخِيهِ ثُمَّ ٱسْتَخْرَجَهَا مِن وِعَآءِ أَخِيهِ ۚ كَذَٰلِكَ كِدْنَا لِيُوسُفَ ۖ مَا كَانَ لِيَأْخُذَ أَخَاهُ فِى دِينِ ٱلْمَلِكِ إِلَّآ أَن يَشَآءَ ٱللَّهُ ۚ نَرْفَعُ دَرَجَـٰتٍ مَّن نَّشَآءُ ۗ وَفَوْقَ كُلِّ ذِى عِلْمٍ عَلِيمٌ
Fabada-a bi-aw'iyatihim qabla wi'aaa'i akheehi summas takhrajahaa minw wi 'aaa'i akheeh; kazaalika kidnaa li Yoosuf; maa kaana liyaakhuza akhaahu fee deenil maliki illaaa any yashaaa'al laah; narfa'u darajaatim man nashaaa'; wa fawqa kulli zee 'ilmin 'Aleem
[Joseph] began by searching their bags, then his brother’s, and he pulled it out from his brother’s bag. In this way We devised a plan for Joseph- if God had not willed it so, he could not have detained his brother as a penalty under the king’s law- We raise the rank of whoever We will. Above everyone who has knowledge there is the One who is all knowing.
So he began with their bags before his brother's bag, then drew it out from his brother's bag. In this way we devised a plan for Yusuf — he could not have taken his brother under the king's law had God not willed it. We raise in rank whom we will, and above every possessor of knowledge is one who knows more.