+ Post New Thread
Results 1 to 4 of 4
Coding Thread, One for you PHP gurus in Coding and Web Development; given this PHP code PHP Code: var_dump ( $x );  produces this output Code: array(1) { ["http://www.mysite.uk/it_services/index.php/component/content/?view=23:it-services&id=339:my-account"]=> array(3) { ["relation"]=> ...
  1. #1

    unixman_again's Avatar
    Join Date
    Nov 2011
    Posts
    660
    Thank Post
    25
    Thanked 133 Times in 100 Posts
    Rep Power
    134

    One for you PHP gurus

    given this PHP code
    PHP Code:
    var_dump($x); 
    produces this output
    Code:
    array(1) { ["http://www.mysite.uk/it_services/index.php/component/content/?view=23:it-services&id=339:my-account"]=> array(3) { ["relation"]=> string(9) "canonical" ["relType"]=> string(3) "rel" ["attribs"]=> array(0) { } } }
    How can I just get it to output the url? Thanks!
    (I can normally do this but I'm clearly suffering brain fade today )

  2. #2

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    I think...
    Code:
    key($x);
    EDIT: or actually it probably needs slicing to a single element first, i.e.

    Code:
    key(array_slice($x, 0, 1));
    Last edited by LosOjos; 26th November 2013 at 04:00 PM.

  3. Thanks to LosOjos from:

    unixman_again (26th November 2013)

  4. #3

    unixman_again's Avatar
    Join Date
    Nov 2011
    Posts
    660
    Thank Post
    25
    Thanked 133 Times in 100 Posts
    Rep Power
    134
    <SMACK FOREHEAD>
    Of course!

  5. #4

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    Quote Originally Posted by unixman_again View Post
    <SMACK FOREHEAD>
    Of course!
    I've had enough of those moments in the last few days (albeit in C#/SQL) to feel your pain!

SHARE:
+ Post New Thread

Similar Threads

  1. [Video] One for you Blade Runner Fans
    By mattx in forum Jokes/Interweb Things
    Replies: 0
    Last Post: 15th September 2010, 05:32 PM
  2. One for all you XBOX 360 online players.
    By tosca925 in forum General Chat
    Replies: 7
    Last Post: 4th December 2008, 04:44 PM
  3. Replies: 37
    Last Post: 8th November 2006, 07:24 PM
  4. Replies: 18
    Last Post: 11th July 2005, 09:19 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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