You have to use your escape characters correctly. You can’t have a single-quote ('
) inside of a single-quote-encapsulated string. It breaks it. In order to continue the string and have PHP interpret your inner single-quote literally, you have to escape it with \
.
$json_url = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=\'jaipur\'&sensor=false');
Or you can use the alternative string encapsulator, double-quote ("
).
$json_url = file_get_contents("http://maps.google.com/maps/api/geocode/json?address='jaipur'&sensor=false");
For future reference, Parse error: syntax error, unexpected T_STRING
usually means you have a bad string somewhere on that line.
Related Posts:
- PHP parse/syntax errors; and how to solve them
- Best way to parse RSS/Atom feeds with PHP
- Parse (split) a string in C++ using string delimiter (standard C++)
- How to reformat JSON in Notepad++?
- How can I fix MySQL error #1064?
- How to convert code from C# to PHP
- How to parse in C
- How to extract data from a PDF file while keeping track of its structure?
- How to use Stanford Parser in NLTK using Python
- How do I make a redirect in PHP?
- Expected RBRACE, but the bracket is there?
- Are there dictionaries in php?
- pdo – Call to a member function prepare() on a non-object
- php refresh current page?
- PHP to write Tab Characters inside a file?
- How to write a link like which link to the same page in PHP?
- PHP date yesterday [duplicate]
- Clear cache in Symfony: `cache:clear` or `rm -rf`?
- How to deprecate a function used in a plugin?
- get current category ID php
- Converting timestamps to local time with date_l18n()
- To close or not to close php
- Make Google index the entire post if it is separated into several pages
- Check if widget has content
- Displaying post per day
- Saving Plugin settings to the database
- Php string not working in WordPress Functions.php [duplicate]
- Get custom post type REST API not working
- Why isn’t my if/elseif/else working correctly here?
- Insert After Second Paragraph Without Tag?
- if statement on database query
- WordPress plugin installation
- wordpress custom post type remove duplicate menu item
- Is it possible to move wordpress out of webroot?
- the_author() not working outside the loop
- page template for attachement page?
- Styling images coming from another blog
- PHP If user is logged in & on home page redirect
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Ajax $wpdb not returning table data
- IMG src weird behaviour inside a single post loop
- woocommerce subscriptions – get expiration date [closed]
- Using WordPress gettext functions in a library outside plugin or theme scope
- Showing content from one page on another
- How to insert a single row to WP database table?
- Get date numerical and separate?
- How can I randomize a Nextgen Gallery Slideshow [closed]
- Where to put snarfer.php?
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- WooCommerce custom product dimensions
- Notify comment author upon reply
- WordPress get_avatar function not correct working
- Display an image if odd number of posts in grid
- HTML escaping data with ajax requests
- Custom ajax call returns 0 [duplicate]
- How to use wordpress function wp_enqueue_script() in php?
- Parse error: syntax error, unexpected ‘,’
- Create a package of products as one Item in woocommerce?
- How to set cookies
- How can I split my query result in 2 arrays?
- how to edit a specific post slug using a php code?
- Display the video of a post_format Video
- Manually Create PHP Page For A Redirect
- Get All In One SEO Pack to use custom field instead of Content
- php loading different structure than source code
- Submit form to db
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- WordPress User Meta value variable into Google Gauge Chart
- WP Function does not trigger on Webhook API Call
- “WARNING: Found @$ in the file __ Possible error suppression is being used
- Submiting with problems on one of the options php wprdpress
- Changing ALT-tag for logo in wordpress
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- str_replace remove words from title
- Woocommerce checkout page – custom field checkbox value into email
- Create form which redirects to site in network?
- How to echo a PHP Code After the Content
- Custom Plugin Develoment, Form Action
- Print post category name from a custom post type wordpress
- Restrict File Type Uploads by User on Wordress via functions.php
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- AJAX Returning Way Too Many Posts
- WordPress AJAX load post metadata in modal
- Add point on excerpt post
- Give permission to admin to see user’s page
- add shortcode heading showing multiple time
- List of child pages fetch next results at link click
- Send Custom Post Notification to Followers
- Limit ads appearing more than three times
- How does add_action ‘comment_post’ work?
- Showing Subcategory’s Name and Link Instead of Parent Category’s
- reorder a WP_Query, using a dropdown
- Wrap every 2 divs in row – for each loop [closed]
- Convert ACF checkbox choices to links [closed]
- Why a class property becomes empty?
- how to goto specific page number including title with permalink
- get_the_term_list give me a whitespace
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]