SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Location
    Belgium
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    get PHP from MySQL

    I want to make a tutorial website, but making the PHP tutorial I ran into a little problem. I usually save my tutorials in MySQL in HTML. This works fine, the HTML is shown as text with the correct layout.

    The PHP only works partially. I want to do the following:

    <p>test</p>
    <?php
    highlight_string('<?php echo "test"; ?>');
    ?>
    On my screen i see, 'echo "test"' but without the highlights. Any suggestions on how to change this?
    Last edited by arneman; Jul 1, 2009 at 17:04.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in the documentation it says you need to include the php tags in the string:

    http://php.net/manual/en/function.highlight-string.php

  3. #3
    SitePoint Member
    Join Date
    Jul 2009
    Location
    Belgium
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did that, just forgot it in my example, I've edited my first post.

  4. #4
    SitePoint Member
    Join Date
    Jul 2009
    Location
    Belgium
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind I worked around it using a second field containing the PHP code.

    Thanks anyway.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •