vabole Posted November 23, 2006 Report Share Posted November 23, 2006 Kā, lai izveido ko tādu $yo = ' include "aaa/..."; '; Link to comment Share on other sites More sharing options...
Kristabs Posted November 23, 2006 Report Share Posted November 23, 2006 eval() Link to comment Share on other sites More sharing options...
KAC Posted November 23, 2006 Report Share Posted November 23, 2006 varbuut domaaji sho - http://lv.php.net/manual/en/ref.outcontrol.php Link to comment Share on other sites More sharing options...
bubu Posted November 23, 2006 Report Share Posted November 23, 2006 Ja nevajag php kodu izpildīt, tad $yo = file_get_contents("aaa/..."); Ja vajag - tad lasi to, kas KAC dotajā linkā rakstīs. Link to comment Share on other sites More sharing options...
vabole Posted November 24, 2006 Author Report Share Posted November 24, 2006 http://lv.php.net/manual/en/ref.outcontrol.php Nevaru saprast, var kāds piemēru parādīt, tādu elementāru. Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2006 Report Share Posted November 24, 2006 vabole, tu vēlies, lai tev viss outputs, kas nāk no tā 'aaa/...' faila, tiktu ielikts $yo mainīgajā ? ob_start(); require('aaa/...'); $yo = ob_get_contents(); ob_end_clean(); echo $yo; Bet lai tas strādāt, tad iekš php.ini faila Output buffering direktīvai jābūt On. Link to comment Share on other sites More sharing options...
bubu Posted November 24, 2006 Report Share Posted November 24, 2006 Nav jābūt On. ob_start() ir tas pats, kas tā direktīva On. Tāpēc var tikai vienu no tiem lietot. Link to comment Share on other sites More sharing options...
Delfins Posted November 24, 2006 Report Share Posted November 24, 2006 Ir viens triks, ja nu būs vajagdzīgs... mans.php <?php return true; ?> index.php <?php $ret = include('mans.php'); print $ret;?> Link to comment Share on other sites More sharing options...
vabole Posted November 24, 2006 Author Report Share Posted November 24, 2006 (edited) vabole, tu vēlies, lai tev viss outputs, kas nāk no tā 'aaa/...' faila, tiktu ielikts $yo mainīgajā ? Jā. Sanāca vajadzīgais, paldies. Edited November 24, 2006 by vabole Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2006 Report Share Posted November 24, 2006 Nu tad atbilde tev ir :). Link to comment Share on other sites More sharing options...
Recommended Posts